Skip to content

Commit 243853d

Browse files
committed
Remove JS code to open in new window
Having links open in a new window without some visual indication is very unexpected and pop-up blockers often block them. The default value for i_newwin was changed to 0 in 2020, time to remove this entirely.
1 parent 3f4f284 commit 243853d

File tree

12 files changed

+33
-232
lines changed

12 files changed

+33
-232
lines changed

SETUP/db_schema.sql

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,8 @@ CREATE TABLE `user_profiles` (
550550
`id` int(10) unsigned NOT NULL auto_increment,
551551
`u_ref` int(10) unsigned NOT NULL default '0',
552552
`profilename` varchar(30) NOT NULL default 'default',
553-
`i_res` tinyint(1) default '1',
554553
`i_type` tinyint(1) default '0',
555554
`i_layout` tinyint(1) default '0',
556-
`i_toolbar` tinyint(1) default '0',
557-
`i_statusbar` tinyint(1) default '0',
558-
`i_newwin` tinyint(1) default '0',
559555
`v_fnts` tinyint(2) default '0',
560556
`v_fntf` tinyint(1) default '2',
561557
`v_fntf_other` varchar(32) default '',

SETUP/devex/dpdev-docker/dp_db.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ INSERT INTO `project_events` VALUES (1,1451401587,'projectID5682a1735f76a','pm',
4646

4747
INSERT INTO `projects` VALUES ('Demonology','Doe, John','English','pm','Match the scan, man!','html','projectID5682a1735f76a','','proofer',1451401669,1458275991,1451401587,1599454842,'','P1.proj_avail',NULL,'testingonly',NULL,1,'Other','average',0,'','',33,32,NULL,'_internal','pm','pm','',0,'','');
4848

49-
INSERT INTO `user_profiles` VALUES (1,1,'default',1,0,0,0,0,1,0,0,'',50,40,65,1,0,0,0,'',35,6,70,1,0),(2,2,'default',1,0,0,0,0,1,0,0,'',50,40,65,1,0,0,0,'',35,6,70,1,0),(3,3,'default',1,0,0,0,0,1,0,2,'',50,40,65,1,0,0,0,'',35,6,70,1,0);
49+
INSERT INTO `user_profiles` VALUES (1,1,'default',0,0,0,0,'',50,40,65,1,0,0,0,'',35,6,70,1,0),(2,2,'default',0,0,0,0,'',50,40,65,1,0,0,0,'',35,6,70,1,0),(3,3,'default',0,0,0,2,'',50,40,65,1,0,0,0,'',35,6,70,1,0);
5050

5151
INSERT INTO `user_project_info` VALUES ('proofer','projectID5682a1735f76a',1599454853,1599454842,0,0,0,0,0,0,0,0,0);
5252

SETUP/tests/smoketests/test_tables.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ REPLACE INTO `users` VALUES ('userID460b20a8a8a71','BKeir','teststeel','teststee
1616
/* $up = new UserProfile(); $up->foo = bar; $up->save(); does not allow new
1717
* profiles to be created with programmatic control of id.
1818
*/
19-
REPLACE INTO `user_profiles` VALUES (110,105,'default',4,1,1,0,0,1,5,6,'',50,40,65,1,0,5,6,'',35,20,70,1,0);
19+
REPLACE INTO `user_profiles` VALUES (110,105,'default',1,1,5,6,'',50,40,65,1,0,5,6,'',35,20,70,1,0);
2020

2121
/* This can be done with $s = new Settings('admin'); $s->set_true('sitemanager');
2222
* But there's not much point until we can do some of the rest with code.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
$relPath = '../../../pinc/';
3+
include_once($relPath.'base.inc');
4+
5+
header('Content-type: text/plain');
6+
7+
// ------------------------------------------------------------
8+
9+
echo "Dropping some columns on user_profiles...\n";
10+
$sql = "
11+
ALTER TABLE user_profiles
12+
DROP COLUMN i_res,
13+
DROP COLUMN i_toolbar,
14+
DROP COLUMN i_statusbar,
15+
DROP COLUMN i_newwin;
16+
";
17+
18+
echo "$sql\n";
19+
20+
mysqli_query(DPDatabase::get_connection(), $sql) or die(mysqli_error(DPDatabase::get_connection()));
21+
22+
// ------------------------------------------------------------
23+
24+
echo "\nDone!\n";

faq/pophelp/prefs/prefs_pophelp.inc

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -310,34 +310,6 @@ The lower control frame is not included when calculating this percentage.</p>"),
310310
'content' => _("<p>Enable/Disable wrapping of lines in the proofreading area that exceed the 'Length of Text Lines' setting.</p>"),
311311
],
312312

313-
'set_newwindow' =>
314-
[
315-
'title' => _("Launch in New Window"),
316-
'content' =>
317-
_("<p>This setting specifies if the proofreading interface will launch in a new window or not.</p>"),
318-
],
319-
320-
'set_statusbar' =>
321-
[
322-
'title' => _("Show Status Bar"),
323-
'content' =>
324-
_("<p>This setting specifies if the standard browser status bar should be displayed when 'Launch in New Window' is set to Yes.</p>"),
325-
],
326-
327-
'set_toolbar' =>
328-
[
329-
'title' => _("Show Toolbar"),
330-
'content' =>
331-
_("<p>This setting specifies if the standard browser toolbars should be displayed when 'Launch in New Window' is set to Yes.</p>"),
332-
],
333-
334-
// FIXME This setting, and all the code that uses it and the 1000px for calculations should die. :D
335-
'set_screenres' =>
336-
[
337-
'title' => _("Screen Resolution"),
338-
'content' => _("<p>You may select a screen resolution from the dropdown list.</p>"),
339-
],
340-
341313
'set_showspecialcolors' =>
342314
[
343315
'title' => _("Show Special Colors"),

pinc/UserProfile.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ class NonexistentUserProfileException extends Exception
88
* @property int $id;
99
* @property int $u_ref;
1010
* @property string $profilename;
11-
* @property int $i_res;
1211
* @property int $i_type;
1312
* @property int $i_layout;
14-
* @property bool $i_toolbar;
15-
* @property bool $i_statusbar;
16-
* @property bool $i_newwin;
1713
* @property int $v_fnts;
1814
* @property int $v_fntf;
1915
* @property string $v_fntf_other;

pinc/js_newwin.inc

Lines changed: 0 additions & 52 deletions
This file was deleted.

pinc/resolution.inc

Lines changed: 0 additions & 76 deletions
This file was deleted.

pinc/showavailablebooks.inc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ include_once($relPath.'Settings.inc');
44
include_once($relPath.'special_colors.inc');
55
include_once($relPath.'forum_interface.inc'); // get_forum_email_address get_url_to_compose_message_to_user
66
include_once($relPath.'user_is.inc'); // user_is_a_sitemanager
7-
include_once($relPath.'js_newwin.inc'); // prep_for_links_to_project_pages get_onclick_attr_for_link_to_project_page
87
include_once($relPath.'genres.inc');
98
include_once($relPath.'post_processing.inc');
109

@@ -455,10 +454,6 @@ function show_project_listing(
455454
}
456455
$result = DPDatabase::query($query);
457456

458-
if (is_a($stage, 'Round')) {
459-
prep_for_links_to_project_pages();
460-
}
461-
462457
// Start the table.
463458
echo "\n<table id='$anchor' class='availprojectlisting stage_$stage->id'>";
464459
echo "<tr class='center-align'>";
@@ -522,12 +517,7 @@ function show_project_listing(
522517
}
523518
} elseif ($col_id == "nameofwork") {
524519
$eURL = "$code_url/project.php?id={$book['projectid']}&amp;expected_state={$book['state']}";
525-
$onclick_attr = (
526-
is_a($stage, 'Round')
527-
? get_onclick_attr_for_link_to_project_page($eURL)
528-
: ""
529-
);
530-
$cell = "<a href=\"$eURL\" $onclick_attr>" . html_safe($book['nameofwork']) . "</a>";
520+
$cell = "<a href=\"$eURL\">" . html_safe($book['nameofwork']) . "</a>";
531521
} elseif ($col_id == "genre") {
532522
$genre = $book['trans_genre'];
533523
if ($book['difficulty'] == "beginner") {

tools/proofers/my_projects.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
include_once($relPath.'theme.inc');
55
include_once($relPath.'Project.inc');
66
include_once($relPath.'User.inc');
7-
include_once($relPath.'js_newwin.inc'); // get_js_for_links_to_project_pages(), get_onclick_attr_for_link_to_project_page()
87
include_once($relPath.'Settings.inc');
98
include_once($relPath.'pg.inc'); // get_pg_catalog_link_for_etext()
109
include_once($relPath.'gradual.inc'); // maybe_output_new_proofer_message()
@@ -65,9 +64,7 @@
6564
"text_other" => sprintf(_("%s's Projects"), $username),
6665
];
6766

68-
$extra_args['js_data'] = get_js_for_links_to_project_pages();
69-
70-
output_header(get_usertext($page_header), NO_STATSBAR, $extra_args);
67+
output_header(get_usertext($page_header), NO_STATSBAR);
7168

7269
output_link_box($username);
7370

@@ -166,8 +163,7 @@
166163
echo html_safe($orig_nameofwork) . " <i>" . _("merged into") . "</i> ";
167164
}
168165
$url = "$code_url/project.php?id=$projectid";
169-
$onclick_attr = get_onclick_attr_for_link_to_project_page($url);
170-
echo "<a href='$url' $onclick_attr>" . html_safe($nameofwork) . "</a>";
166+
echo "<a href='$url'>" . html_safe($nameofwork) . "</a>";
171167
echo "</td>\n";
172168

173169
if (isset($colspecs['state'])) {

0 commit comments

Comments
 (0)