/usr/share/hotot/ext/org.hotot.appmask/entry.js is in hotot-common 1:0.9.8.14-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | if (typeof ext == 'undefined') var ext = {};
ext.AppMask = {
id: 'org.hotot.appmask',
name: 'AppMask',
description: 'Change your source application name.',
version: '0.3',
author: 'Xu Zhen',
icon: "icon.png",
url: 'https://github.com/xnreformer/hotot-exts',
prefs: {
"consumer_key": conf.vars.consumer_key,
"consumer_secret": conf.vars.consumer_secret
},
def_prefs: {
"consumer_key": conf.vars.consumer_key,
"consumer_secret": conf.vars.consumer_secret
},
db: null,
open_option_dialog:
function open_option_dialog() {
var title = 'App Setting';
var body = '<style>'+
'#ext_hotot_appmask_opt_dialog .dialog_body>ol{list-style-type:decimal;margin-left:25px}'+
'#ext_hotot_appmask_opt_dialog .dialog_body li{margin:10px 0}'+
'#ext_hotot_appmask_opt_dialog .dialog_body table{margin:0 10px}'+
'#ext_hotot_appmask_opt_dialog .dialog_body td{border:none;padding:0px}'+
'#ext_hotot_appmask_opt_dialog .dialog_body input{width:200px}'+
'</style>'+
'<ol>'+
'<li>'+
'Visit <a href="https://dev.twitter.com/apps">https://dev.twitter.com/apps</a> and create your own application'+
'</li>'+
'<li>'+
'<span>Paste consumer key & secret here:</span>'+
'<table>'+
'<tbody>'+
'<tr>'+
'<td>Consumer Key:</td>'+
'<td><input type="text" id="ext_hotot_appmask_consumer_key"/></td>'+
'</tr>'+
'<tr>'+
'<td>Consumer Secret:</td>'+
'<td><input type="text" id="ext_hotot_appmask_consumer_secret"/></td>'+
'</tr>'+
'</tbody>'+
'</table>'+
'</li>'+
'<li>'+
'<span>Clean old token & reauthorize<span>'+
'</li>'+
'</ol>';
ext.AppMask.option_dialog = widget.DialogManager.build_dialog(
'#ext_hotot_appmask_opt_dialog', title, '', body, [
{id:'#ext_btn_appmask_reset', label: 'Reset', click: ext.AppMask.on_btn_reset_clicked},
{id:'#ext_btn_appmask_save', label: 'Save', click: ext.AppMask.on_btn_save_prefs_clicked}
]);
ext.AppMask.option_dialog.set_styles('header', {'display': 'none', 'height': '0'});
ext.AppMask.option_dialog.resize(400, 280);
$("#ext_btn_appmask_reset").css("padding-right", "10px");
var prefs = ext.AppMask.prefs;
for (var key in prefs) {
$('#ext_hotot_appmask_' + key).val(prefs[key]);
}
ext.AppMask.option_dialog.open();
},
on_btn_reset_clicked:
function on_btn_reset_clicked() {
var prefs = ext.AppMask.def_prefs;
for (var key in prefs) {
$('#ext_hotot_appmask_' + key).val(prefs[key]);
}
},
on_btn_save_prefs_clicked:
function on_btn_save_prefs_clicked() {
var prefs = {
"consumer_key": "",
"consumer_secret": ""
};
for (var key in prefs) {
var value = $('#ext_hotot_appmask_' + key).val();
if (value) {
prefs[key] = value;
} else {
toast.set("Please fill the " + key.replace("_", " ") + " field").show();
$('#ext_hotot_appmask_' + key).focus();
return;
}
}
ext.AppMask.prefs = prefs;
ext.AppMask.db.set('prefs', JSON.stringify(prefs));
ext.AppMask.option_dialog.close();
ext.AppMask.option_dialog = null;
},
enable:
function enable() {
var key = ext.AppMask.prefs.consumer_key;
var secret = ext.AppMask.prefs.consumer_secret;
if (key && secret) {
conf.vars.consumer_key = globals.twitterClient.oauth.key = key;
conf.vars.consumer_secret = globals.twitterClient.oauth.secret = secret;
}
},
disable:
function disable() {
var key = ext.AppMask.def_prefs.consumer_key;
var secret = ext.AppMask.def_prefs.consumer_secret;
conf.vars.consumer_key = globals.twitterClient.oauth.key = key;
conf.vars.consumer_secret = globals.twitterClient.oauth.secret = secret;
},
options:
function options() {
ext.AppMask.open_option_dialog();
},
}
ext.AppMask.db = new ext.Preferences(ext.AppMask.id);
ext.AppMask.db.get('prefs', function(key, val) {
if (val) {
var prefs = JSON.parse(val);
if (prefs.consumer_key != null) {
ext.AppMask.prefs.consumer_key = prefs.consumer_key;
}
if (prefs.consumer_secret != null) {
ext.AppMask.prefs.consumer_secret = prefs.consumer_secret;
}
}
});
|