9 changed files with 319 additions and 75 deletions
After Width: | Height: | Size: 160 B |
@ -1,18 +1,84 @@ |
|||
.profile > .delete { |
|||
background-position: center; |
|||
height: 20px; |
|||
width: 20px; |
|||
} |
|||
/* @override http://192.168.1.20:5000/static/profile_plugin/profile.css */ |
|||
|
|||
.profile .types .type .handle { |
|||
background: url('../../images/handle.png') center; |
|||
display: inline-block; |
|||
height: 20px; |
|||
width: 20px; |
|||
.add_new_profile { |
|||
padding: 20px; |
|||
display: block; |
|||
text-align: center; |
|||
font-size: 20px; |
|||
border-bottom: 1px solid rgba(255,255,255,0.2); |
|||
} |
|||
|
|||
.profile .types .type .delete { |
|||
background-position: center; |
|||
height: 20px; |
|||
width: 20px; |
|||
} |
|||
.profile { border-bottom: 1px solid rgba(255,255,255,0.2) } |
|||
|
|||
.profile > .delete { |
|||
height: 20px; |
|||
width: 20px; |
|||
position: absolute; |
|||
margin-left: 690px; |
|||
padding: 14px; |
|||
background-position: center; |
|||
} |
|||
|
|||
.profile .formHint { |
|||
width: 250px !important; |
|||
} |
|||
|
|||
.profile .wait_for { |
|||
position: absolute; |
|||
margin: -45px 0 0 437px; |
|||
} |
|||
|
|||
.profile .wait_for input { |
|||
margin: 0 5px !important; |
|||
} |
|||
|
|||
.profile .types { |
|||
padding: 0; |
|||
margin: 0 20px 0 -4px; |
|||
display: inline-block; |
|||
} |
|||
|
|||
.profile .types li { |
|||
padding: 3px 5px; |
|||
border-bottom: 1px solid rgba(255,255,255,0.2); |
|||
} |
|||
.profile .types li:last-child { border: 0; } |
|||
|
|||
.profile .types li > * { |
|||
display: inline-block; |
|||
vertical-align: middle; |
|||
line-height: 0; |
|||
margin-right: 10px; |
|||
} |
|||
|
|||
.profile .quality_type select { |
|||
width: 186px; |
|||
margin-left: -1px; |
|||
} |
|||
|
|||
.profile .types li.is_empty .check, .profile .types li.is_empty .delete, .profile .types li.is_empty .handle { |
|||
visibility: hidden; |
|||
} |
|||
|
|||
.profile .types .type .handle { |
|||
background: url('./handle.png') center; |
|||
display: inline-block; |
|||
height: 20px; |
|||
width: 20px; |
|||
cursor: grab; |
|||
cursor: -moz-grab; |
|||
cursor: -webkit-grab; |
|||
margin: 0; |
|||
} |
|||
|
|||
.profile .types .type .delete { |
|||
background-position: left center; |
|||
height: 20px; |
|||
width: 20px; |
|||
visibility: hidden; |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.profile .types .type:hover:not(.is_empty) .delete { |
|||
visibility: visible; |
|||
} |
Before Width: | Height: | Size: 206 B |
@ -0,0 +1,81 @@ |
|||
var Question = new Class( { |
|||
|
|||
initialize : function(question, hint, answers) { |
|||
var self = this |
|||
|
|||
self.question = question |
|||
self.hint = hint |
|||
self.answers = answers |
|||
|
|||
self.createQuestion() |
|||
self.answers.each(function(answer) { |
|||
self.createAnswer(answer) |
|||
}) |
|||
self.createMask() |
|||
|
|||
}, |
|||
|
|||
createMask : function() { |
|||
var self = this |
|||
|
|||
$(document.body).mask( { |
|||
'hideOnClick' : true, |
|||
'destroyOnHide' : true, |
|||
'onHide' : function() { |
|||
self.container.destroy(); |
|||
} |
|||
}).show(); |
|||
}, |
|||
|
|||
createQuestion : function() { |
|||
|
|||
this.container = new Element('div', { |
|||
'class' : 'question' |
|||
}).adopt( |
|||
new Element('h3', { |
|||
'html': this.question |
|||
}), |
|||
new Element('div.hint', { |
|||
'html': this.hint |
|||
}) |
|||
).inject(document.body) |
|||
|
|||
this.container.position( { |
|||
'position' : 'center' |
|||
}); |
|||
|
|||
}, |
|||
|
|||
createAnswer : function(options) { |
|||
var self = this |
|||
|
|||
var answer = new Element('a', Object.merge(options, { |
|||
'class' : 'answer button '+(options['class'] || '')+(options['cancel'] ? ' cancel' : '') |
|||
})).inject(this.container) |
|||
|
|||
if (options.cancel) { |
|||
answer.addEvent('click', self.close.bind(self)) |
|||
} |
|||
else if (options.request) { |
|||
answer.addEvent('click', function(e){ |
|||
e.stop(); |
|||
new Request(Object.merge(options, { |
|||
'url': options.href, |
|||
'onSuccess': function() { |
|||
(options.onSuccess || function(){})() |
|||
self.close(); |
|||
} |
|||
})).send(); |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
close : function() { |
|||
$(document.body).get('mask').destroy(); |
|||
}, |
|||
|
|||
toElement : function() { |
|||
return this.container |
|||
} |
|||
|
|||
}) |
Loading…
Reference in new issue