Skip to content

Commit

Permalink
Modify placeholder for new scripts (#1850)
Browse files Browse the repository at this point in the history
* Also move the options for this out regardless of state/mode... going to try something in a while to further assist there.

Post #1847
  • Loading branch information
Martii authored Nov 20, 2021
1 parent 40e497c commit 46cdd88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2409,6 +2409,11 @@ exports.editScript = function (aReq, aRes, aNext) {
});
});

// Lockdown
options.lockdown = {};
options.lockdown.scriptStorageRO = process.env.READ_ONLY_SCRIPT_STORAGE === 'true';
options.lockdown.updateURLCheck = process.env.FORCE_BUSY_UPDATEURL_CHECK === 'true';

if (!isNew) {
installNameBase = scriptStorage.getInstallNameBase(aReq);

Expand All @@ -2433,11 +2438,6 @@ exports.editScript = function (aReq, aRes, aNext) {
return;
}

// Lockdown
options.lockdown = {};
options.lockdown.scriptStorageRO = process.env.READ_ONLY_SCRIPT_STORAGE === 'true';
options.lockdown.updateURLCheck = process.env.FORCE_BUSY_UPDATEURL_CHECK === 'true';

// Script
options.script = script = modelParser.parseScript(aScript);

Expand Down
5 changes: 4 additions & 1 deletion views/includes/scripts/scriptEditor.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
var placeholder = null;
var username = '{{authedUser.name}}' || 'username';
var isLib = {{isLib}};
var isUpdateURLCheck = {{lockdown.updateURLCheck}};
var now = new Date();
var year = now.getFullYear();

Expand Down Expand Up @@ -258,7 +259,9 @@
'// @version 0.0.0',
'// @include https://www.example.com/*',
'// @grant none',
'// ==/UserScript==',
(isUpdateURLCheck
? '// @updateURL https://openuserjs.org/meta/' + username + '/Getting_Started_with_a_User_Script.meta.js\n// ==/UserScript=='
: '// ==/UserScript=='),
'',
'// ==OpenUserJS==',
'// @author ' + username,
Expand Down

0 comments on commit 46cdd88

Please sign in to comment.