Spring cleanup
This commit is contained in:
@@ -43,8 +43,8 @@ class Plugin(object):
|
||||
http_failed_disabled = {}
|
||||
http_opener = requests.Session()
|
||||
|
||||
def __new__(typ, *args, **kwargs):
|
||||
new_plugin = super(Plugin, typ).__new__(typ)
|
||||
def __new__(cls, *args, **kwargs):
|
||||
new_plugin = super(Plugin, cls).__new__(cls)
|
||||
new_plugin.registerPlugin()
|
||||
|
||||
return new_plugin
|
||||
@@ -329,7 +329,7 @@ class Plugin(object):
|
||||
elif data.get('password'):
|
||||
tag += '{{%s}}' % data.get('password')
|
||||
|
||||
max_length = 127 - len(tag) # Some filesystems don't support 128+ long filenames
|
||||
max_length = 127 - len(tag) # Some filesystems don't support 128+ long filenames
|
||||
return '%s%s' % (toSafeString(toUnicode(release_name)[:max_length]), tag)
|
||||
|
||||
def createFileName(self, data, filedata, media):
|
||||
@@ -349,6 +349,7 @@ class Plugin(object):
|
||||
now = time.time()
|
||||
file_too_new = False
|
||||
|
||||
file_time = []
|
||||
for cur_file in files:
|
||||
|
||||
# File got removed while checking
|
||||
|
||||
@@ -17,7 +17,8 @@ if os.name == 'nt':
|
||||
raise ImportError("Missing the win32file module, which is a part of the prerequisite \
|
||||
pywin32 package. You can get it from http://sourceforge.net/projects/pywin32/files/pywin32/")
|
||||
else:
|
||||
import win32file #@UnresolvedImport
|
||||
# noinspection PyUnresolvedReferences
|
||||
import win32file
|
||||
|
||||
autoload = 'FileBrowser'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ var CategoryListBase = new Class({
|
||||
setup: function(categories){
|
||||
var self = this;
|
||||
|
||||
self.categories = []
|
||||
self.categories = [];
|
||||
Array.each(categories, self.createCategory.bind(self));
|
||||
|
||||
},
|
||||
@@ -17,7 +17,7 @@ var CategoryListBase = new Class({
|
||||
addSettings: function(){
|
||||
var self = this;
|
||||
|
||||
self.settings = App.getPage('Settings')
|
||||
self.settings = App.getPage('Settings');
|
||||
self.settings.addEvent('create', function(){
|
||||
var tab = self.settings.createSubTab('category', {
|
||||
'label': 'Categories',
|
||||
@@ -31,7 +31,7 @@ var CategoryListBase = new Class({
|
||||
self.createList();
|
||||
self.createOrdering();
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
// Add categories in renamer
|
||||
self.settings.addEvent('create', function(){
|
||||
@@ -97,9 +97,9 @@ var CategoryListBase = new Class({
|
||||
createCategory: function(data){
|
||||
var self = this;
|
||||
|
||||
var data = data || {'id': randomString()}
|
||||
var category = new Category(data)
|
||||
self.categories.include(category)
|
||||
var data = data || {'id': randomString()};
|
||||
var category = new Category(data);
|
||||
self.categories.include(category);
|
||||
|
||||
return category;
|
||||
},
|
||||
@@ -108,7 +108,7 @@ var CategoryListBase = new Class({
|
||||
var self = this;
|
||||
|
||||
var category_list;
|
||||
var group = self.settings.createGroup({
|
||||
self.settings.createGroup({
|
||||
'label': 'Category ordering'
|
||||
}).adopt(
|
||||
new Element('.ctrlHolder#category_ordering').adopt(
|
||||
@@ -118,7 +118,7 @@ var CategoryListBase = new Class({
|
||||
'html': 'Change the order the categories are in the dropdown list.<br />First one will be default.'
|
||||
})
|
||||
)
|
||||
).inject(self.content)
|
||||
).inject(self.content);
|
||||
|
||||
Array.each(self.categories, function(category){
|
||||
new Element('li', {'data-id': category.data._id}).adopt(
|
||||
@@ -145,7 +145,7 @@ var CategoryListBase = new Class({
|
||||
|
||||
var ids = [];
|
||||
|
||||
self.category_sortable.list.getElements('li').each(function(el, nr){
|
||||
self.category_sortable.list.getElements('li').each(function(el){
|
||||
ids.include(el.get('data-id'));
|
||||
});
|
||||
|
||||
@@ -157,7 +157,7 @@ var CategoryListBase = new Class({
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
window.CategoryList = new CategoryListBase();
|
||||
|
||||
@@ -235,8 +235,6 @@ var Category = new Class({
|
||||
if(self.save_timer) clearTimeout(self.save_timer);
|
||||
self.save_timer = (function(){
|
||||
|
||||
var data = self.getData();
|
||||
|
||||
Api.request('category.save', {
|
||||
'data': self.getData(),
|
||||
'useSpinner': true,
|
||||
@@ -257,7 +255,7 @@ var Category = new Class({
|
||||
getData: function(){
|
||||
var self = this;
|
||||
|
||||
var data = {
|
||||
return {
|
||||
'id' : self.data._id,
|
||||
'label' : self.el.getElement('.category_label input').get('value'),
|
||||
'required' : self.el.getElement('.category_required input').get('value'),
|
||||
@@ -265,8 +263,6 @@ var Category = new Class({
|
||||
'ignored' : self.el.getElement('.category_ignored input').get('value'),
|
||||
'destination': self.data.destination
|
||||
}
|
||||
|
||||
return data
|
||||
},
|
||||
|
||||
del: function(){
|
||||
|
||||
@@ -77,8 +77,8 @@ class Dashboard(Plugin):
|
||||
if coming_soon:
|
||||
|
||||
# Don't list older movies
|
||||
if ((not late and (media['info']['year'] >= now_year-1) and (not eta.get('dvd') and not eta.get('theater') or eta.get('dvd') and eta.get('dvd') > (now - 2419200))) or
|
||||
(late and ((media['info']['year'] < now_year-1) or ((eta.get('dvd', 0) > 0 or eta.get('theater')) and eta.get('dvd') < (now - 2419200))))):
|
||||
if ((not late and (media['info']['year'] >= now_year - 1) and (not eta.get('dvd') and not eta.get('theater') or eta.get('dvd') and eta.get('dvd') > (now - 2419200))) or
|
||||
(late and (media['info']['year'] < now_year - 1 or (eta.get('dvd', 0) > 0 or eta.get('theater')) and eta.get('dvd') < (now - 2419200)))):
|
||||
medias.append(media)
|
||||
|
||||
if len(medias) >= limit:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import os.path
|
||||
import time
|
||||
import traceback
|
||||
|
||||
from couchpotato import get_db
|
||||
@@ -64,7 +63,7 @@ class FileManager(Plugin):
|
||||
def download(self, url = '', dest = None, overwrite = False, urlopen_kwargs = None):
|
||||
if not urlopen_kwargs: urlopen_kwargs = {}
|
||||
|
||||
if not dest: # to Cache
|
||||
if not dest: # to Cache
|
||||
dest = os.path.join(Env.get('cache_dir'), '%s.%s' % (md5(url), getExt(url)))
|
||||
|
||||
if not overwrite and os.path.isfile(dest):
|
||||
|
||||
@@ -67,14 +67,14 @@ class Logging(Plugin):
|
||||
if x is nr:
|
||||
current_path = path
|
||||
|
||||
log = ''
|
||||
log_content = ''
|
||||
if current_path:
|
||||
f = open(current_path, 'r')
|
||||
log = f.read()
|
||||
log_content = f.read()
|
||||
|
||||
return {
|
||||
'success': True,
|
||||
'log': toUnicode(log),
|
||||
'log': toUnicode(log_content),
|
||||
'total': total,
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
overflow: hidden;
|
||||
line-height: 150%;
|
||||
font-size: 11px;
|
||||
font-family: Lucida Console, Monaco, Nimbus Mono L;
|
||||
font-family: Lucida Console, Monaco, Nimbus Mono L, monospace, serif;
|
||||
}
|
||||
|
||||
.page.log .container .error {
|
||||
|
||||
@@ -42,7 +42,7 @@ Page.Log = new Class({
|
||||
}
|
||||
}
|
||||
}).inject(nav);
|
||||
};
|
||||
}
|
||||
|
||||
new Element('li', {
|
||||
'text': 'clear',
|
||||
@@ -63,7 +63,6 @@ Page.Log = new Class({
|
||||
},
|
||||
|
||||
addColors: function(text){
|
||||
var self = this;
|
||||
|
||||
text = text
|
||||
.replace(/&/g, '&')
|
||||
@@ -74,9 +73,9 @@ Page.Log = new Class({
|
||||
.replace(/\u001b\[36m/gi, '</span><span class="debug">')
|
||||
.replace(/\u001b\[33m/gi, '</span><span class="debug">')
|
||||
.replace(/\u001b\[0m\n/gi, '</div><div class="time">')
|
||||
.replace(/\u001b\[0m/gi, '</span><span>')
|
||||
.replace(/\u001b\[0m/gi, '</span><span>');
|
||||
|
||||
return '<div class="time">' + text + '</div>';
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
@@ -160,7 +160,7 @@ class Manage(Plugin):
|
||||
except:
|
||||
log.error('Failed updating library: %s', (traceback.format_exc()))
|
||||
|
||||
while True and not self.shuttingDown():
|
||||
while self.in_progress and len(self.in_progress) > 0 and not self.shuttingDown():
|
||||
|
||||
delete_me = {}
|
||||
|
||||
@@ -171,14 +171,12 @@ class Manage(Plugin):
|
||||
for delete in delete_me:
|
||||
del self.in_progress[delete]
|
||||
|
||||
if len(self.in_progress) == 0:
|
||||
break
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
fireEvent('notify.frontend', type = 'manage.updating', data = False)
|
||||
self.in_progress = False
|
||||
|
||||
# noinspection PyDefaultArgument
|
||||
def createAddToLibrary(self, folder, added_identifiers = []):
|
||||
|
||||
def addToLibrary(group, total_found, to_go):
|
||||
@@ -219,7 +217,7 @@ class Manage(Plugin):
|
||||
pr = self.in_progress[folder]
|
||||
pr['to_go'] -= 1
|
||||
|
||||
avg = (time.time() - pr['started'])/(pr['total'] - pr['to_go'])
|
||||
avg = (time.time() - pr['started']) / (pr['total'] - pr['to_go'])
|
||||
pr['eta'] = tryInt(avg * pr['to_go'])
|
||||
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ var Profile = new Class({
|
||||
'label' : self.el.getElement('.quality_label input').get('value'),
|
||||
'wait_for' : self.el.getElement('.wait_for input').get('value'),
|
||||
'types': []
|
||||
}
|
||||
};
|
||||
|
||||
Array.each(self.type_container.getElements('.type'), function(type){
|
||||
if(!type.hasClass('deleted') && type.getElement('select').get('value') != -1)
|
||||
@@ -129,7 +129,7 @@ var Profile = new Class({
|
||||
'3d': +type.getElement('input.3d[type=checkbox]').checked,
|
||||
'wait_for': 0
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
return data
|
||||
},
|
||||
@@ -261,10 +261,10 @@ Profile.Type = new Class({
|
||||
self.finish = new Element('input.inlay.finish[type=checkbox]', {
|
||||
'checked': data.finish !== undefined ? data.finish : 1,
|
||||
'events': {
|
||||
'change': function(e){
|
||||
'change': function(){
|
||||
if(self.el == self.el.getParent().getElement(':first-child')){
|
||||
self.finish_class.check();
|
||||
alert('Top quality always finishes the search')
|
||||
alert('Top quality always finishes the search');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ Profile.Type = new Class({
|
||||
self['3d'] = new Element('input.inlay.3d[type=checkbox]', {
|
||||
'checked': data['3d'] !== undefined ? data['3d'] : 0,
|
||||
'events': {
|
||||
'change': function(e){
|
||||
'change': function(){
|
||||
self.fireEvent('change');
|
||||
}
|
||||
}
|
||||
@@ -363,4 +363,4 @@ Profile.Type = new Class({
|
||||
return this.el;
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
@@ -63,6 +63,7 @@ class QualityPlugin(Plugin):
|
||||
|
||||
addEvent('app.test', self.doTest)
|
||||
|
||||
self.order = []
|
||||
self.addOrder()
|
||||
|
||||
def addOrder(self):
|
||||
@@ -247,12 +248,12 @@ class QualityPlugin(Plugin):
|
||||
qualities = [qualities] if isinstance(qualities, (str, unicode)) else qualities
|
||||
|
||||
for alt in qualities:
|
||||
if (isinstance(alt, tuple)):
|
||||
if isinstance(alt, tuple):
|
||||
if len(set(words) & set(alt)) == len(alt):
|
||||
log.debug('Found %s via %s %s in %s', (quality['identifier'], tag_type, quality.get(tag_type), cur_file))
|
||||
score += points.get(tag_type)
|
||||
|
||||
if (isinstance(alt, (str, unicode)) and ss(alt.lower()) in cur_file.lower()):
|
||||
if isinstance(alt, (str, unicode)) and ss(alt.lower()) in cur_file.lower():
|
||||
log.debug('Found %s via %s %s in %s', (quality['identifier'], tag_type, quality.get(tag_type), cur_file))
|
||||
score += points.get(tag_type) / 2
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ var QualityBase = new Class({
|
||||
|
||||
self.qualities = data.qualities;
|
||||
|
||||
self.profiles = []
|
||||
self.profiles = [];
|
||||
Array.each(data.profiles, self.createProfilesClass.bind(self));
|
||||
|
||||
App.addEvent('load', self.addSettings.bind(self))
|
||||
@@ -37,7 +37,7 @@ var QualityBase = new Class({
|
||||
addSettings: function(){
|
||||
var self = this;
|
||||
|
||||
self.settings = App.getPage('Settings')
|
||||
self.settings = App.getPage('Settings');
|
||||
self.settings.addEvent('create', function(){
|
||||
var tab = self.settings.createSubTab('profile', {
|
||||
'label': 'Quality',
|
||||
@@ -91,9 +91,9 @@ var QualityBase = new Class({
|
||||
createProfilesClass: function(data){
|
||||
var self = this;
|
||||
|
||||
var data = data || {'id': randomString()}
|
||||
var profile = new Profile(data)
|
||||
self.profiles.include(profile)
|
||||
var data = data || {'id': randomString()};
|
||||
var profile = new Profile(data);
|
||||
self.profiles.include(profile);
|
||||
|
||||
return profile;
|
||||
},
|
||||
@@ -102,7 +102,7 @@ var QualityBase = new Class({
|
||||
var self = this;
|
||||
|
||||
var profile_list;
|
||||
var group = self.settings.createGroup({
|
||||
self.settings.createGroup({
|
||||
'label': 'Profile Defaults',
|
||||
'description': '(Needs refresh \'' +(App.isMac() ? 'CMD+R' : 'F5')+ '\' after editing)'
|
||||
}).adopt(
|
||||
@@ -113,7 +113,7 @@ var QualityBase = new Class({
|
||||
'html': 'Change the order the profiles are in the dropdown list. Uncheck to hide it completely.<br />First one will be default.'
|
||||
})
|
||||
)
|
||||
).inject(self.content)
|
||||
).inject(self.content);
|
||||
|
||||
Array.each(self.profiles, function(profile){
|
||||
var check;
|
||||
@@ -175,14 +175,14 @@ var QualityBase = new Class({
|
||||
'description': 'Edit the minimal and maximum sizes (in MB) for each quality.',
|
||||
'advanced': true,
|
||||
'name': 'sizes'
|
||||
}).inject(self.content)
|
||||
}).inject(self.content);
|
||||
|
||||
|
||||
new Element('div.item.head.ctrlHolder').adopt(
|
||||
new Element('span.label', {'text': 'Quality'}),
|
||||
new Element('span.min', {'text': 'Min'}),
|
||||
new Element('span.max', {'text': 'Max'})
|
||||
).inject(group)
|
||||
).inject(group);
|
||||
|
||||
Array.each(self.qualities, function(quality){
|
||||
new Element('div.ctrlHolder.item').adopt(
|
||||
|
||||
@@ -148,7 +148,7 @@ class Renamer(Plugin):
|
||||
log.debug('The provided media folder %s does not exist. Trying to find it in the \'from\' folder.', media_folder)
|
||||
|
||||
# Update to the from folder
|
||||
if len(release_download.get('files'), []) == 1:
|
||||
if len(release_download.get('files', [])) == 1:
|
||||
new_media_folder = from_folder
|
||||
else:
|
||||
new_media_folder = os.path.join(from_folder, os.path.basename(media_folder))
|
||||
@@ -504,7 +504,7 @@ class Renamer(Plugin):
|
||||
fireEvent('release.update_status', release['_id'], status = 'downloaded', single = True)
|
||||
|
||||
# Remove leftover files
|
||||
if not remove_leftovers: # Don't remove anything
|
||||
if not remove_leftovers: # Don't remove anything
|
||||
break
|
||||
|
||||
log.debug('Removing leftover files')
|
||||
@@ -529,8 +529,8 @@ class Renamer(Plugin):
|
||||
|
||||
parent_dir = os.path.dirname(src)
|
||||
if delete_folders.count(parent_dir) == 0 and os.path.isdir(parent_dir) and \
|
||||
not isSubFolder(destination, parent_dir) and not isSubFolder(media_folder, parent_dir) and \
|
||||
not isSubFolder(parent_dir, base_folder):
|
||||
not isSubFolder(destination, parent_dir) and not isSubFolder(media_folder, parent_dir) and \
|
||||
not isSubFolder(parent_dir, base_folder):
|
||||
|
||||
delete_folders.append(parent_dir)
|
||||
|
||||
@@ -659,7 +659,7 @@ Remove it if you want it to be renamed (again, or at least let it try again)
|
||||
|
||||
for filename in tag_files:
|
||||
|
||||
# Dont tag .ignore files
|
||||
# Don't tag .ignore files
|
||||
if os.path.splitext(filename)[1] == '.ignore':
|
||||
continue
|
||||
|
||||
@@ -1017,7 +1017,7 @@ Remove it if you want it to be renamed (again, or at least let it try again)
|
||||
if release_download['pause'] and self.conf('file_action') == 'link':
|
||||
fireEvent('download.pause', release_download = release_download, pause = False, single = True)
|
||||
if release_download['process_complete']:
|
||||
#First make sure the files were succesfully processed
|
||||
# First make sure the files were successfully processed
|
||||
if not self.hastagRelease(release_download = release_download, tag = 'failed_rename'):
|
||||
# Remove the seeding tag if it exists
|
||||
self.untagRelease(release_download = release_download, tag = 'renamed_already')
|
||||
|
||||
@@ -28,7 +28,7 @@ class Scanner(Plugin):
|
||||
|
||||
ignored_in_path = [os.path.sep + 'extracted' + os.path.sep, 'extracting', '_unpack', '_failed_', '_unknown_', '_exists_', '_failed_remove_',
|
||||
'_failed_rename_', '.appledouble', '.appledb', '.appledesktop', os.path.sep + '._', '.ds_store', 'cp.cpnfo',
|
||||
'thumbs.db', 'ehthumbs.db', 'desktop.ini'] #unpacking, smb-crap, hidden files
|
||||
'thumbs.db', 'ehthumbs.db', 'desktop.ini'] # unpacking, smb-crap, hidden files
|
||||
ignore_names = ['extract', 'extracting', 'extracted', 'movie', 'movies', 'film', 'films', 'download', 'downloads', 'video_ts', 'audio_ts', 'bdmv', 'certificate']
|
||||
extensions = {
|
||||
'movie': ['mkv', 'wmv', 'avi', 'mpg', 'mpeg', 'mp4', 'm2ts', 'iso', 'img', 'mdf', 'ts', 'm4v'],
|
||||
@@ -589,7 +589,7 @@ class Scanner(Plugin):
|
||||
|
||||
if len(movie) > 0:
|
||||
imdb_id = movie[0].get('imdb')
|
||||
log.debug('Found movie via search: %s', cur_file)
|
||||
log.debug('Found movie via search: %s', identifier)
|
||||
if imdb_id: break
|
||||
else:
|
||||
log.debug('Identifier to short to use for search: %s', identifier)
|
||||
@@ -835,6 +835,7 @@ class Scanner(Plugin):
|
||||
cleaned = ' '.join(re.split('\W+', simplifyString(release_name)))
|
||||
cleaned = re.sub(self.clean, ' ', cleaned)
|
||||
|
||||
year = None
|
||||
for year_str in [file_name, release_name, cleaned]:
|
||||
if not year_str: continue
|
||||
year = self.findYear(year_str)
|
||||
@@ -843,7 +844,7 @@ class Scanner(Plugin):
|
||||
|
||||
cp_guess = {}
|
||||
|
||||
if year: # Split name on year
|
||||
if year: # Split name on year
|
||||
try:
|
||||
movie_name = cleaned.rsplit(year, 1).pop(0).strip()
|
||||
if movie_name:
|
||||
|
||||
+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 ;)')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
|
||||
.page.wizard h1 {
|
||||
padding: 10px 0;
|
||||
margin: 0 5px;
|
||||
display: block;
|
||||
font-size: 30px;
|
||||
margin-top: 80px;
|
||||
margin: 80px 5px 0;
|
||||
}
|
||||
|
||||
.page.wizard .description {
|
||||
@@ -52,7 +51,7 @@
|
||||
font-weight: normal;
|
||||
border-bottom: 4px solid transparent;
|
||||
}
|
||||
|
||||
|
||||
.page.wizard .tabs li:hover a { border-color: #047792; }
|
||||
.page.wizard .tabs li.done a { border-color: #04bce6; }
|
||||
|
||||
|
||||
@@ -111,10 +111,10 @@ Page.Wizard = new Class({
|
||||
var form = self.el.getElement('.uniForm');
|
||||
var tabs = self.el.getElement('.tabs');
|
||||
|
||||
self.groups.each(function(group, nr){
|
||||
self.groups.each(function(group){
|
||||
|
||||
if(self.headers[group]){
|
||||
group_container = new Element('.wgroup_'+group, {
|
||||
var group_container = new Element('.wgroup_'+group, {
|
||||
'styles': {
|
||||
'opacity': 0.2
|
||||
},
|
||||
@@ -129,7 +129,7 @@ Page.Wizard = new Class({
|
||||
})
|
||||
}
|
||||
|
||||
var content = self.headers[group].content
|
||||
var content = self.headers[group].content;
|
||||
group_container.adopt(
|
||||
new Element('h1', {
|
||||
'text': self.headers[group].title
|
||||
@@ -144,7 +144,7 @@ Page.Wizard = new Class({
|
||||
var tab_navigation = tabs.getElement('.t_'+group);
|
||||
|
||||
if(!tab_navigation && self.headers[group] && self.headers[group].include){
|
||||
tab_navigation = []
|
||||
tab_navigation = [];
|
||||
self.headers[group].include.each(function(inc){
|
||||
tab_navigation.include(tabs.getElement('.t_'+inc));
|
||||
})
|
||||
@@ -157,7 +157,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', {
|
||||
@@ -215,9 +215,9 @@ Page.Wizard = new Class({
|
||||
self.groups.each(function(groups2, nr2){
|
||||
var t2 = self.el.getElement('.t_'+groups2);
|
||||
t2[nr2 > nr ? 'removeClass' : 'addClass' ]('done');
|
||||
})
|
||||
});
|
||||
g.tween('opacity', 1);
|
||||
}
|
||||
};
|
||||
|
||||
if(nr == 0)
|
||||
func();
|
||||
@@ -241,4 +241,4 @@ Page.Wizard = new Class({
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user