Spring cleanup
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ var isCorrectUrl = function() {
|
||||
}
|
||||
var addUserscript = function() {
|
||||
// Add window param
|
||||
document.body.setAttribute('cp_auto_open', true)
|
||||
document.body.setAttribute('cp_auto_open', 'true')
|
||||
|
||||
// Load userscript
|
||||
var e = document.createElement('script');
|
||||
@@ -35,7 +35,7 @@ class Userscript(Plugin):
|
||||
'host': host,
|
||||
}
|
||||
|
||||
return self.renderTemplate(__file__, 'bookmark.js', **params)
|
||||
return self.renderTemplate(__file__, 'bookmark.js_tmpl', **params)
|
||||
|
||||
def getIncludes(self, **kwargs):
|
||||
|
||||
@@ -60,7 +60,7 @@ class Userscript(Plugin):
|
||||
'host': '%s://%s' % (self.request.protocol, self.request.headers.get('X-Forwarded-Host') or self.request.headers.get('host')),
|
||||
}
|
||||
|
||||
script = klass.renderTemplate(__file__, 'template.js', **params)
|
||||
script = klass.renderTemplate(__file__, 'template.js_tmpl', **params)
|
||||
klass.createFile(os.path.join(Env.get('cache_dir'), 'couchpotato.user.js'), script)
|
||||
|
||||
self.redirect(Env.get('api_base') + 'file.cache/couchpotato.user.js')
|
||||
|
||||
@@ -12,7 +12,7 @@ Page.Userscript = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
indexAction: function(param){
|
||||
indexAction: function(){
|
||||
var self = this;
|
||||
|
||||
self.el.adopt(
|
||||
@@ -60,7 +60,7 @@ var UserscriptSettingTab = new Class({
|
||||
addSettings: function(){
|
||||
var self = this;
|
||||
|
||||
self.settings = App.getPage('Settings')
|
||||
self.settings = App.getPage('Settings');
|
||||
self.settings.addEvent('create', function(){
|
||||
|
||||
var host_url = window.location.protocol + '//' + window.location.host;
|
||||
@@ -74,7 +74,7 @@ var UserscriptSettingTab = new Class({
|
||||
'text': 'Install userscript',
|
||||
'href': Api.createUrl('userscript.get')+randomString()+'/couchpotato.user.js',
|
||||
'target': '_blank'
|
||||
}),
|
||||
}),
|
||||
new Element('span.or[text=or]'),
|
||||
new Element('span.bookmarklet').adopt(
|
||||
new Element('a.button.green', {
|
||||
@@ -86,7 +86,7 @@ var UserscriptSettingTab = new Class({
|
||||
'target': '',
|
||||
'events': {
|
||||
'click': function(e){
|
||||
(e).stop()
|
||||
(e).stop();
|
||||
alert('Drag it to your bookmark ;)')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user