From 6442eb7dca22568bcd2b137b4c6ff37fe746fba8 Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 12 Aug 2015 10:00:13 +0200 Subject: [PATCH] Adopt > grab --- .../core/_base/downloader/static/downloaders.js | 2 +- couchpotato/core/media/movie/_base/static/list.js | 2 +- couchpotato/core/media/movie/_base/static/search.js | 8 ++++---- .../core/notifications/core/static/notification.js | 2 +- couchpotato/core/plugins/quality/static/quality.js | 2 +- couchpotato/core/plugins/wizard/static/wizard.js | 6 +++--- couchpotato/static/scripts/combined.plugins.min.js | 20 ++++++++++---------- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/couchpotato/core/_base/downloader/static/downloaders.js b/couchpotato/core/_base/downloader/static/downloaders.js index 81202fe..f963ca8 100644 --- a/couchpotato/core/_base/downloader/static/downloaders.js +++ b/couchpotato/core/_base/downloader/static/downloaders.js @@ -27,7 +27,7 @@ var DownloadersBase = new Class({ if(button_name.contains('Downloaders')) return; - new Element('.ctrlHolder.test_button').adopt( + new Element('.ctrlHolder.test_button').grab( new Element('a.button', { 'text': button_name, 'events': { diff --git a/couchpotato/core/media/movie/_base/static/list.js b/couchpotato/core/media/movie/_base/static/list.js index c28baf5..308c0a0 100644 --- a/couchpotato/core/media/movie/_base/static/list.js +++ b/couchpotato/core/media/movie/_base/static/list.js @@ -582,7 +582,7 @@ var MovieList = new Class({ var loader_timeout; if(self.movies.length === 0 && self.options.loader){ - self.loader_first = new Element('div.mask.loading.with_message').adopt( + self.loader_first = new Element('div.mask.loading.with_message').grab( new Element('div.message', {'text': self.options.title ? 'Loading \'' + self.options.title + '\'' : 'Loading...'}) ).inject(self.el, 'top'); createSpinner(self.loader_first); diff --git a/couchpotato/core/media/movie/_base/static/search.js b/couchpotato/core/media/movie/_base/static/search.js index 8bcc50f..734f464 100644 --- a/couchpotato/core/media/movie/_base/static/search.js +++ b/couchpotato/core/media/movie/_base/static/search.js @@ -38,8 +38,8 @@ var BlockSearchMovieItem = new Class({ 'width': null }) : null, self.options_el = new Element('div.options'), - self.data_container = new Element('div.data').adopt( - self.info_container = new Element('div.info').adopt( + self.data_container = new Element('div.data').grab( + self.info_container = new Element('div.info').grab( new Element('h2', { 'class': info.in_wanted && info.in_wanted.profile_id || in_library ? 'in_library_wanted' : '', 'title': self.getTitle() @@ -122,7 +122,7 @@ var BlockSearchMovieItem = new Class({ }, 'onComplete': function(json){ self.options_el.empty(); - self.options_el.adopt( + self.options_el.grab( new Element('div.message', { 'text': json.success ? 'Movie successfully added.' : 'Movie didn\'t add properly. Check logs' }) @@ -133,7 +133,7 @@ var BlockSearchMovieItem = new Class({ }, 'onFailure': function(){ self.options_el.empty(); - self.options_el.adopt( + self.options_el.grab( new Element('div.message', { 'text': 'Something went wrong, check the logs for more info.' }) diff --git a/couchpotato/core/notifications/core/static/notification.js b/couchpotato/core/notifications/core/static/notification.js index 57713c8..c9ac01b 100644 --- a/couchpotato/core/notifications/core/static/notification.js +++ b/couchpotato/core/notifications/core/static/notification.js @@ -221,7 +221,7 @@ var NotificationBase = new Class({ if(button_name.contains('Notifications')) return; - new Element('.ctrlHolder.test_button').adopt( + new Element('.ctrlHolder.test_button').grab( new Element('a.button', { 'text': button_name, 'events': { diff --git a/couchpotato/core/plugins/quality/static/quality.js b/couchpotato/core/plugins/quality/static/quality.js index 4025f95..67924b0 100644 --- a/couchpotato/core/plugins/quality/static/quality.js +++ b/couchpotato/core/plugins/quality/static/quality.js @@ -110,7 +110,7 @@ var QualityBase = new Class({ self.settings.createGroup({ 'label': 'Profile Defaults', 'description': '(Needs refresh \'' +(App.isMac() ? 'CMD+R' : 'F5')+ '\' after editing)' - }).adopt( + }).grab( new Element('.ctrlHolder#profile_ordering').adopt( new Element('label[text=Order]'), self.profiles_list = new Element('ul'), diff --git a/couchpotato/core/plugins/wizard/static/wizard.js b/couchpotato/core/plugins/wizard/static/wizard.js index ed2d59f..ec1101b 100644 --- a/couchpotato/core/plugins/wizard/static/wizard.js +++ b/couchpotato/core/plugins/wizard/static/wizard.js @@ -50,7 +50,7 @@ Page.Wizard = new Class({ 'description': 'Are you done? Did you fill in everything as much as possible?' + '
Be sure to check the settings to see what more CP can do!

' + '
After you\'ve used CP for a while, and you like it (which of course you will), consider supporting CP. Maybe even by writing some code.
Or by getting a subscription at Usenet Server or Newshosting.
', - 'content': new Element('div').adopt( + 'content': new Element('div').grab( new Element('a.button.green', { 'styles': { 'margin-top': 20 @@ -158,7 +158,7 @@ Page.Wizard = new Class({ self.el.getElement('.tab_'+inc).inject(group_container); }); - new Element('li.t_'+group).adopt( + new Element('li.t_'+group).grab( new Element('a', { 'href': App.createUrl('wizard/'+group), 'text': (self.headers[group].label || group).capitalize() @@ -179,7 +179,7 @@ Page.Wizard = new Class({ } } else { - new Element('li.t_'+group).adopt( + new Element('li.t_'+group).grab( new Element('a', { 'href': App.createUrl('wizard/'+group), 'text': (self.headers[group].label || group).capitalize() diff --git a/couchpotato/static/scripts/combined.plugins.min.js b/couchpotato/static/scripts/combined.plugins.min.js index d76b239..342d2bb 100644 --- a/couchpotato/static/scripts/combined.plugins.min.js +++ b/couchpotato/static/scripts/combined.plugins.min.js @@ -14,7 +14,7 @@ var DownloadersBase = new Class({ addTestButton: function(fieldset, plugin_name) { var self = this, button_name = self.testButtonName(fieldset); if (button_name.contains("Downloaders")) return; - new Element(".ctrlHolder.test_button").adopt(new Element("a.button", { + new Element(".ctrlHolder.test_button").grab(new Element("a.button", { text: button_name, events: { click: function() { @@ -837,7 +837,7 @@ var MovieList = new Class({ } var loader_timeout; if (self.movies.length === 0 && self.options.loader) { - self.loader_first = new Element("div.mask.loading.with_message").adopt(new Element("div.message", { + self.loader_first = new Element("div.mask.loading.with_message").grab(new Element("div.message", { text: self.options.title ? "Loading '" + self.options.title + "'" : "Loading..." })).inject(self.el, "top"); createSpinner(self.loader_first); @@ -2102,7 +2102,7 @@ var BlockSearchMovieItem = new Class({ src: info.images.poster[0], height: null, width: null - }) : null, self.options_el = new Element("div.options"), self.data_container = new Element("div.data").adopt(self.info_container = new Element("div.info").adopt(new Element("h2", { + }) : null, self.options_el = new Element("div.options"), self.data_container = new Element("div.data").grab(self.info_container = new Element("div.info").grab(new Element("h2", { class: info.in_wanted && info.in_wanted.profile_id || in_library ? "in_library_wanted" : "", title: self.getTitle() }).adopt(self.title = new Element("span.title", { @@ -2159,7 +2159,7 @@ var BlockSearchMovieItem = new Class({ }, onComplete: function(json) { self.options_el.empty(); - self.options_el.adopt(new Element("div.message", { + self.options_el.grab(new Element("div.message", { text: json.success ? "Movie successfully added." : "Movie didn't add properly. Check logs" })); self.mask.fade("out"); @@ -2167,7 +2167,7 @@ var BlockSearchMovieItem = new Class({ }, onFailure: function() { self.options_el.empty(); - self.options_el.adopt(new Element("div.message", { + self.options_el.grab(new Element("div.message", { text: "Something went wrong, check the logs for more info." })); self.mask.fade("out"); @@ -2616,7 +2616,7 @@ var NotificationBase = new Class({ addTestButton: function(fieldset, plugin_name) { var self = this, button_name = self.testButtonName(fieldset); if (button_name.contains("Notifications")) return; - new Element(".ctrlHolder.test_button").adopt(new Element("a.button", { + new Element(".ctrlHolder.test_button").grab(new Element("a.button", { text: button_name, events: { click: function() { @@ -3496,7 +3496,7 @@ var QualityBase = new Class({ self.settings.createGroup({ label: "Profile Defaults", description: "(Needs refresh '" + (App.isMac() ? "CMD+R" : "F5") + "' after editing)" - }).adopt(new Element(".ctrlHolder#profile_ordering").adopt(new Element("label[text=Order]"), self.profiles_list = new Element("ul"), new Element("p.formHint", { + }).grab(new Element(".ctrlHolder#profile_ordering").adopt(new Element("label[text=Order]"), self.profiles_list = new Element("ul"), new Element("p.formHint", { html: "Change the order the profiles are in the dropdown list. Uncheck to hide it completely.
First one will be default." }))).inject(self.content); Array.each(self.profiles, function(profile) { @@ -3729,7 +3729,7 @@ Page.Wizard = new Class({ finish: { title: "Finishing Up", description: "Are you done? Did you fill in everything as much as possible?" + "
Be sure to check the settings to see what more CP can do!

" + '
After you\'ve used CP for a while, and you like it (which of course you will), consider supporting CP. Maybe even by writing some code.
Or by getting a subscription at Usenet Server or Newshosting.
', - content: new Element("div").adopt(new Element("a.button.green", { + content: new Element("div").grab(new Element("a.button.green", { styles: { "margin-top": 20 }, @@ -3809,7 +3809,7 @@ Page.Wizard = new Class({ self.headers[group].include.each(function(inc) { self.el.getElement(".tab_" + inc).inject(group_container); }); - new Element("li.t_" + group).adopt(new Element("a", { + new Element("li.t_" + group).grab(new Element("a", { href: App.createUrl("wizard/" + group), text: (self.headers[group].label || group).capitalize() })).inject(tabs); @@ -3821,7 +3821,7 @@ Page.Wizard = new Class({ if (url_split.length > 3) a.set("href", a.get("href").replace(url_split[url_split.length - 3] + "/", "")); } } else { - new Element("li.t_" + group).adopt(new Element("a", { + new Element("li.t_" + group).grab(new Element("a", { href: App.createUrl("wizard/" + group), text: (self.headers[group].label || group).capitalize() })).inject(tabs);