Skip to content

Commit 206fabb

Browse files
committed
Problems loading styles...
1 parent 3c7c0c4 commit 206fabb

File tree

10 files changed

+84
-59
lines changed

10 files changed

+84
-59
lines changed

featherbb/Controller/Admin/Groups.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ public function addedit($req, $res, $args)
114114
'active_page' => 'admin',
115115
'admin_console' => true,
116116
'focus_element' => array('groups2', 'req_title'),
117-
'required_fields' => array('req_title' => __('Group title label')),
118117
'group' => $group,
119118
'groups' => $groups,
120119
'id' => $args['id'],

featherbb/Controller/Auth.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public function login($req, $res, $args)
6767
View::setPageInfo(array(
6868
'active_page' => 'login',
6969
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Login')),
70-
'required_fields' => array('req_username' => __('Username'), 'req_password' => __('Password')),
7170
'focus_element' => array('login', 'req_username'),
7271
)
7372
)->addTemplate('login/form.php')->display();
@@ -153,7 +152,6 @@ public function forget($req, $res, $args)
153152
// 'errors' => $this->model->password_forgotten(),
154153
'active_page' => 'login',
155154
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Request pass')),
156-
'required_fields' => array('req_email' => __('Email')),
157155
'focus_element' => array('request_pass', 'req_email'),
158156
)
159157
)->addTemplate('login/password_forgotten.php')->display();

featherbb/Controller/Register.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public function display($req, $res, $args)
5858
View::setPageInfo(array(
5959
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Register')),
6060
'focus_element' => array('register', 'req_user'),
61-
'required_fields' => array('req_user' => __('Username'), 'req_password1' => __('Password'), 'req_password2' => __('Confirm pass'), 'req_email1' => __('Email'), 'req_email2' => __('Email').' 2', 'captcha' => __('Robot title')),
6261
'active_page' => 'register',
6362
'is_indexed' => true,
6463
'errors' => $user['errors'],

featherbb/Core/Interfaces/Input.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static function getParam($key, $default = null, $sanitize = true)
1111
{
1212
$result = Request::getParam($key, $default);
1313
if ($sanitize) {
14-
$result = htmlspecialchars($result);
14+
$result = htmlspecialchars($result, ENT_QUOTES, 'UTF-8');
1515
$result = trim($result);
1616
}
1717
return $result;
@@ -20,7 +20,7 @@ public static function post($key, $default = null, $sanitize = false)
2020
{
2121
$result = Request::getParsedBodyParam($key, $default);
2222
if ($sanitize) {
23-
$result = htmlspecialchars($result);
23+
$result = htmlspecialchars($result, ENT_QUOTES, 'UTF-8');
2424
$result = trim($result);
2525
}
2626
return $result;
@@ -29,7 +29,7 @@ public static function query($key, $default = null, $sanitize = true)
2929
{
3030
$result = Request::getQueryParam($key, $default);
3131
if ($sanitize) {
32-
$result = htmlspecialchars($result);
32+
$result = htmlspecialchars($result, ENT_QUOTES, 'UTF-8');
3333
$result = trim($result);
3434
}
3535
return $result;

featherbb/View/admin/groups/add_edit_group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="blockform">
2121
<h2><span><?php _e('Group settings head') ?></span></h2>
2222
<div class="box">
23-
<form id="groups2" method="post" action="" onsubmit="return process_form(this)">
23+
<form id="groups2" method="post" action="">
2424
<input type="hidden" name="csrf_name" value="<?= $csrf_name; ?>"><input type="hidden" name="csrf_value" value="<?= $csrf_value; ?>">
2525
<p class="submittop"><input type="submit" name="add_edit_group" value="<?php _e('Save') ?>" /></p>
2626
<div class="inform">
@@ -37,7 +37,7 @@
3737
<td>
3838
<input type="text" name="req_title" size="25" maxlength="50" value="<?php if ($group['mode'] == 'edit') {
3939
echo Utils::escape($group['info']['g_title']);
40-
} ?>" tabindex="1" />
40+
} ?>" tabindex="1" required />
4141
</td>
4242
</tr>
4343
<tr>

featherbb/View/header.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,32 @@ function process_form(the_form)
255255
<?php
256256
endif;
257257
Container::get('hooks')->fire('view.header.end');
258+
?>
259+
<?php
260+
261+
foreach($assets as $type => $items) {
262+
if ($type == 'js') {
263+
continue;
264+
}
265+
echo "\t".'<!-- '.ucfirst($type).' -->'."\n";
266+
foreach ($items as $item) {
267+
echo "\t".'<link ';
268+
foreach ($item['params'] as $key => $value) {
269+
echo $key.'="'.$value.'" ';
270+
}
271+
echo 'href="'.Url::base_static().'/'.$item['file'].'">'."\n";
272+
}
273+
}
274+
if ($admin_console) {
275+
if (file_exists(ForumEnv::get('FEATHER_ROOT').'style/themes/'.User::get()->style.'/base_admin.css')) {
276+
echo "\t".'<link rel="stylesheet" type="text/css" href="'.Url::base_static().'/style/themes/'.User::get()->style.'/base_admin.css" />'."\n";
277+
} else {
278+
echo "\t".'<link rel="stylesheet" type="text/css" href="'.Url::base_static().'/style/imports/base_admin.css" />'."\n";
279+
}
280+
}
281+
if (!empty($page_head)) :
282+
echo implode("\n", $page_head)."\n";
283+
endif;
284+
285+
Container::get('hooks')->fire('view.header.before.head.tag');
286+
?>

featherbb/View/login/form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
<div class="blockform">
1919
<h2><span><?php _e('Login') ?></span></h2>
2020
<div class="box">
21-
<form id="login" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('login') ?>" onsubmit="return process_form(this)">
21+
<form id="login" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('login') ?>">
2222
<input type="hidden" name="csrf_name" value="<?= $csrf_name; ?>"><input type="hidden" name="csrf_value" value="<?= $csrf_value; ?>">
2323
<div class="inform">
2424
<fieldset>
2525
<legend><?php _e('Login legend') ?></legend>
2626
<div class="infldset">
2727
<input type="hidden" name="form_sent" value="1" />
28-
<label class="conl required"><strong><?php _e('Username') ?> <span><?php _e('Required') ?></span></strong><br /><input type="text" name="req_username" size="25" maxlength="25" tabindex="1" /><br /></label>
29-
<label class="conl required"><strong><?php _e('Password') ?> <span><?php _e('Required') ?></span></strong><br /><input type="password" name="req_password" size="25" tabindex="2" /><br /></label>
28+
<label class="conl required"><strong><?php _e('Username') ?> <span><?php _e('Required') ?></span></strong><br /><input type="text" name="req_username" size="25" maxlength="25" tabindex="1" required /><br /></label>
29+
<label class="conl required"><strong><?php _e('Password') ?> <span><?php _e('Required') ?></span></strong><br /><input type="password" name="req_password" size="25" tabindex="2" required /><br /></label>
3030

3131
<div class="rbox clearb">
3232
<label><input type="checkbox" name="save_pass" value="1" tabindex="3" checked="checked" /><?php _e('Remember me') ?><br /></label>

featherbb/View/login/password_forgotten.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@
4141
<div class="blockform">
4242
<h2><span><?php _e('Request pass') ?></span></h2>
4343
<div class="box">
44-
<form id="request_pass" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('resetPassword') ?>" onsubmit="this.request_pass.disabled=true;if(process_form(this)){return true;}else{this.request_pass.disabled=false;return false;}">
44+
<form id="request_pass" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('resetPassword') ?>">
4545
<input type="hidden" name="csrf_name" value="<?= $csrf_name; ?>"><input type="hidden" name="csrf_value" value="<?= $csrf_value; ?>">
4646
<div class="inform">
4747
<fieldset>
4848
<legend><?php _e('Request pass legend') ?></legend>
4949
<div class="infldset">
5050
<input type="hidden" name="form_sent" value="1" />
51-
<label class="required"><strong><?php _e('Email') ?> <span><?php _e('Required') ?></span></strong><br /><input id="req_email" type="text" name="req_email" size="50" maxlength="80" /><br /></label>
51+
<label class="required"><strong><?php _e('Email') ?> <span><?php _e('Required') ?></span></strong><br /><input id="req_email" type="text" name="req_email" size="50" maxlength="80" required /><br /></label>
5252
<p><?php _e('Request pass info') ?></p>
5353
</div>
5454
</fieldset>

featherbb/View/register/form.php

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<div id="regform" class="blockform">
4444
<h2><span><?php _e('Register') ?></span></h2>
4545
<div class="box">
46-
<form id="register" method="post" action="" onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
46+
<form id="register" method="post" action="">
4747
<input type="hidden" name="csrf_name" value="<?= $csrf_name; ?>"><input type="hidden" name="csrf_value" value="<?= $csrf_value; ?>">
4848
<div class="inform">
4949
<div class="forminfo">
@@ -57,40 +57,36 @@
5757
<input type="hidden" name="form_sent" value="1" />
5858
<input type="hidden" name="username" value="" />
5959
<input type="hidden" name="password" value="" />
60-
<label class="required"><strong><?php _e('Username') ?> <span><?php _e('Required') ?></span></strong><br /><input type="text" name="req_user" value="<?php if (Input::post('req_user')) {
61-
echo Utils::escape(Input::post('req_user'));
62-
} ?>" size="25" maxlength="25" /><br /></label>
60+
<label class="required"><strong><?php _e('Username') ?> <span><?php _e('Required') ?></span></strong><br /><input type="text" name="req_user" value="<?= Input::post('req_user'); ?>" size="25" maxlength="25" required /><br /></label>
6361
</div>
6462
</fieldset>
6563
</div>
66-
<?php if (ForumSettings::get('o_regs_verify') == '0'): ?> <div class="inform">
64+
<?php if (ForumSettings::get('o_regs_verify') == '0'): ?>
65+
<div class="inform">
6766
<fieldset>
6867
<legend><?php _e('Pass legend') ?></legend>
6968
<div class="infldset">
70-
<label class="conl required"><strong><?php _e('Password') ?> <span><?php _e('Required') ?></span></strong><br /><input type="password" name="req_password1" value="<?php if (Input::post('req_password1')) {
71-
echo Utils::escape(Input::post('req_password1'));
72-
} ?>" size="16" /><br /></label>
73-
<label class="conl required"><strong><?php _e('Confirm pass') ?> <span><?php _e('Required') ?></span></strong><br /><input type="password" name="req_password2" value="<?php if (Input::post('req_password2')) {
74-
echo Utils::escape(Input::post('req_password2'));
75-
} ?>" size="16" /><br /></label>
69+
<label class="conl required"><strong><?php _e('Password') ?> <span><?php _e('Required') ?></span></strong><br /><input type="password" name="req_password1" value="<?= Input::post('req_password1') ?>" size="16" required /><br /></label>
70+
<label class="conl required"><strong><?php _e('Confirm pass') ?> <span><?php _e('Required') ?></span></strong><br /><input type="password" name="req_password2" value="<?= Input::post('req_password2'); ?>" size="16" required /><br /></label>
7671
<p class="clearb"><?php _e('Pass info') ?></p>
7772
</div>
7873
</fieldset>
7974
</div>
80-
<?php endif; ?> <div class="inform">
75+
<?php endif; ?>
76+
<div class="inform">
8177
<fieldset>
8278
<legend><?php echo(ForumSettings::get('o_regs_verify') == '1') ? __('Email legend 2') : __('Email legend') ?></legend>
8379
<div class="infldset">
84-
<?php if (ForumSettings::get('o_regs_verify') == '1'): ?> <p><?php _e('Email info') ?></p>
85-
<?php endif; ?> <label class="required"><strong><?php _e('Email') ?> <span><?php _e('Required') ?></span></strong><br />
86-
<input type="text" name="req_email1" value="<?php if (Input::post('req_email1')) {
87-
echo Utils::escape(Input::post('req_email1'));
88-
} ?>" size="50" maxlength="80" /><br /></label>
89-
<?php if (ForumSettings::get('o_regs_verify') == '1'): ?> <label class="required"><strong><?php _e('Confirm email') ?> <span><?php _e('Required') ?></span></strong><br />
90-
<input type="text" name="req_email2" value="<?php if (Input::post('req_email2')) {
91-
echo Utils::escape(Input::post('req_email2'));
92-
} ?>" size="50" maxlength="80" /><br /></label>
93-
<?php endif; ?> </div>
80+
<?php if (ForumSettings::get('o_regs_verify') == '1'): ?>
81+
<p><?php _e('Email info') ?></p>
82+
<?php endif; ?>
83+
<label class="required"><strong><?php _e('Email') ?> <span><?php _e('Required') ?></span></strong><br />
84+
<input type="email" name="req_email1" value="<?= Input::post('req_email1'); ?>" size="50" maxlength="80" required /><br /></label>
85+
<?php if (ForumSettings::get('o_regs_verify') == '1'): ?>
86+
<label class="required"><strong><?php _e('Confirm email') ?> <span><?php _e('Required') ?></span></strong><br />
87+
<input type="email" name="req_email2" value="<?= Input::post('req_email2'); ?>" size="50" maxlength="80" required /><br /></label>
88+
<?php endif; ?>
89+
</div>
9490
</fieldset>
9591
</div>
9692
<?php
@@ -128,7 +124,7 @@
128124
<legend><?php _e('Robot title') ?></legend>
129125
<div class="infldset">
130126
<p><?php _e('Robot info') ?></p>
131-
<label class="required"><strong><?= sprintf(__('Robot question'), $question[$index_questions]) ?> <span><?php _e('Required') ?></span></strong><br /><input name="captcha" id="captcha" type="text" size="10" maxlength="30" /><input name="captcha_q" value="<?= $qencoded ?>" type="hidden" /></label>
127+
<label class="required"><strong><?= sprintf(__('Robot question'), $question[$index_questions]) ?> <span><?php _e('Required') ?></span></strong><br /><input name="captcha" id="captcha" type="text" size="10" maxlength="30" required /><input name="captcha_q" value="<?= $qencoded ?>" type="hidden" /></label>
132128
</div>
133129
</fieldset>
134130
</div>

plugins/fluid-nav/pjax-standalone.js

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
// Attempt to check that a device supports pushstate before attempting to use it.
2020
"is_supported": window.history && window.history.pushState && window.history.replaceState && !navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/),
2121
// Track which scripts have been included in to the page. (used if e)
22-
"loaded_scripts": []
22+
"loaded_scripts": [],
23+
"loaded_styles": []
2324
};
2425

2526
// If PJAX isn't supported we can skip setting up the library all together
@@ -257,6 +258,14 @@
257258
}
258259
}
259260

261+
// Store array or all currently included stylesheets href's
262+
// var links = document.getElementsByTagName('link');
263+
// for(var c=0; c < links.length; c++) {
264+
// if(links[c].href && internal.loaded_styles.indexOf(links[c].src) === -1 && links[c].rel === 'stylesheet'){
265+
// internal.loaded_styles.push(links[c].href);
266+
// }
267+
// }
268+
260269
// Fire ready event once all links are connected
261270
internal.triggerEvent(internal.get_container_node(options.container), 'ready');
262271

@@ -372,27 +381,20 @@
372381
* return void
373382
*/
374383
internal.addStyles = function(html){
375-
return;
376-
// console.log(document.styleSheets[0]);
377-
// Extract JavaScript & eval it (if enabled)
378-
// var stylesheets = html.getElementsByTagName('link').filter(function(link){
379-
// return link.getAttribute('rel') == 'stylesheet';
380-
// });
381-
// console.log(stylesheets);
382-
// for(var sc=0; sc < scripts.length;sc++) {
383-
// // If has an src & src isn't in "loaded_scripts", load the script.
384-
// if(scripts[sc].src && internal.loaded_scripts.indexOf(scripts[sc].src) === -1){
385-
// // Append to head to include
386-
// var s = document.createElement("script");
387-
// s.src = scripts[sc].src;
388-
// document.head.appendChild(s);
389-
// // Add to loaded list
390-
// internal.loaded_scripts.push(scripts[sc].src);
391-
// }else{
392-
// // If raw JS, eval it.
393-
// eval(scripts[sc].innerHTML);
394-
// }
395-
// }
384+
// Extract stylesheets and load them
385+
var styles = document.getElementsByTagName('link');
386+
for(var ss=0; ss < styles.length;ss++) {
387+
console.log(styles[ss].href);
388+
// If has an src & src isn't in "loaded_ssripts", load the ssript.
389+
// if(styles[ss].href && internal.loaded_styles.indexOf(styles[ss].href) === -1 && styles[ss].rel === 'stylesheet'){
390+
// // Append to head to include
391+
// var s = document.createElement("link");
392+
// s.href = styles[ss].href;
393+
// // document.head.appendChild(s);
394+
// // Add to loaded list
395+
// // internal.loaded_styles.push(styles[ss].href);
396+
// }
397+
}
396398
};
397399

398400
/**
@@ -575,6 +577,8 @@
575577
case 'input':
576578
switch (formElement.type) {
577579
case 'text':
580+
case 'number':
581+
case 'email':
578582
case 'hidden':
579583
case 'password':
580584
case 'button': // Not submitted when submitting form manually, though jQuery does serialize this and it can be an HTML4 successful control

0 commit comments

Comments
 (0)