filer: replace "file as" prompt with combobox opened in fancybox

This commit is contained in:
Fabio Comuni 2012-03-28 10:49:34 +02:00
부모 7aec2fd68d
커밋 0a2675d8b6
6개의 변경된 파일145개의 추가작업 그리고 29개의 파일을 삭제

파일 보기

@ -16,8 +16,20 @@ function filer_content(&$a) {
logger('filer: tag ' . $term . ' item ' . $item_id);
if($item_id && strlen($term))
if($item_id && strlen($term)){
// file item
file_tag_save_file(local_user(),$item_id,$term);
} else {
// return filer dialog
$filetags = get_pconfig(local_user(),'system','filetags');
$filetags = explode("][", trim($filetags,"[]"));
$tpl = get_markup_template("filer_dialog.tpl");
$o = replace_macros($tpl, array(
'$field' => array('term', t("File as:"), '', '', $filetags, t('- select -')),
'$submit' => t('Save'),
));
echo $o;
}
killme();
}

4
view/filer_dialog.tpl Normal file
파일 보기

@ -0,0 +1,4 @@
{{ inc field_combobox.tpl }}{{ endinc }}
<div class="settings-submit-wrapper" >
<input id="filer_save" type="button" class="settings-submit" value="$submit" />
</div>

파일 보기

@ -264,15 +264,36 @@ function enableOnUser(){
}
function itemFiler(id) {
reply = prompt("$fileas");
if(reply && reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('filer/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,3000);
liking = 1;
}
var bordercolor = $("input").css("border-color");
$.get('filer/', function(data){
$.fancybox(data);
$("#id_term").keypress(function(){
$(this).css("border-color",bordercolor);
})
$("#select_term").change(function(){
$("#id_term").css("border-color",bordercolor);
})
$("#filer_save").click(function(e){
e.preventDefault();
reply = $("#id_term").val();
if(reply && reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('filer/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,3000);
liking = 1;
$.fancybox.close();
} else {
$("#id_term").css("border-color","#FF0000");
}
return false;
});
});
}
function jotClearLocation() {

파일 보기

@ -264,17 +264,39 @@ function enableOnUser(){
}
function itemFiler(id) {
reply = prompt("$fileas");
if(reply && reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('filer/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,3000);
liking = 1;
}
var bordercolor = $("input").css("border-color");
$.get('filer/', function(data){
$.fancybox(data);
$("#id_term").keypress(function(){
$(this).css("border-color",bordercolor);
})
$("#select_term").change(function(){
$("#id_term").css("border-color",bordercolor);
})
$("#filer_save").click(function(e){
e.preventDefault();
reply = $("#id_term").val();
if(reply && reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('filer/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,3000);
liking = 1;
$.fancybox.close();
} else {
$("#id_term").css("border-color","#FF0000");
}
return false;
});
});
}
function jotClearLocation() {
$('#jot-coord').val('');
$('#profile-nolocation-wrapper').hide();

파일 보기

@ -264,17 +264,39 @@ function enableOnUser(){
}
function itemFiler(id) {
reply = prompt("$fileas");
if(reply && reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('filer/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,3000);
liking = 1;
}
var bordercolor = $("input").css("border-color");
$.get('filer/', function(data){
$.fancybox(data);
$("#id_term").keypress(function(){
$(this).css("border-color",bordercolor);
})
$("#select_term").change(function(){
$("#id_term").css("border-color",bordercolor);
})
$("#filer_save").click(function(e){
e.preventDefault();
reply = $("#id_term").val();
if(reply && reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('filer/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,3000);
liking = 1;
$.fancybox.close();
} else {
$("#id_term").css("border-color","#FF0000");
}
return false;
});
});
}
function jotClearLocation() {
$('#jot-coord').val('');
$('#profile-nolocation-wrapper').hide();

파일 보기

@ -304,6 +304,41 @@ function initEditor(cb) {
}
}
}
function itemFiler(id) {
var bordercolor = $("input").css("border-color");
$.get('filer/', function(data){
$.fancybox(data);
$("#id_term").keypress(function(){
$(this).css("border-color",bordercolor);
})
$("#select_term").change(function(){
$("#id_term").css("border-color",bordercolor);
})
$("#filer_save").click(function(e){
e.preventDefault();
reply = $("#id_term").val();
if(reply && reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('filer/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,3000);
liking = 1;
$.fancybox.close();
} else {
$("#id_term").css("border-color","#FF0000");
}
return false;
});
});
}
function jotClearLocation() {
$('#jot-coord').val('');