增加自定义的og:title

hotfix/远程访问多媒体中心
lyt 7 years ago
parent cdf235d04f
commit f132ea17e3

@ -435,6 +435,7 @@
change_seo_count('ic_seo_title');
change_seo_count('ic_seo_description');
change_seo_count('meta_note');
change_seo_count('meta_note_ogtitle');
init_recommend_popover("#meta_recommend_info", ".meta_recommend_info_box");
init_recommend_popover("#meta_related_info", ".meta_related_info_box");
@ -872,13 +873,23 @@
</div>
<?php } ?>
<label>og:title
<a href="javascript:void(0);" onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_note_ogtitle', $('#meta_note_ogtitle').val())"><i class="text-muted glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0);"
onclick="if(count_valid('meta_note_ogtitle', 'og:title', 20, 60) == true) { meta('save', '<?php echo $information->ic_id; ?>', 'meta_note_ogtitle', $('#meta_note_ogtitle').val()) }">
<i class="text-muted glyphicon glyphicon-hdd"></i>
</a>
<a href="javascript:void(0);" title="为信息添加og:title."><i class="text-muted glyphicon glyphicon-question-sign"></i></a>
<em class="pull-right muted" id="meta_note_ogtitle_count"></em>
</label>
<input name="meta_note_ogtitle" id="meta_note_ogtitle" onkeyup="change_seo_count(this.id);" type="text" class="form-control" value="<?php echo get_meta($information->ic_id, 'meta_note_ogtitle'); ?>" />
<label>og:description
<a href="javascript:void(0);" onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_note', $('#meta_note').val())"><i class="text-muted glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0);" onclick="meta('save', '<?php echo $information->ic_id; ?>', 'meta_note', $('#meta_note').val())"><i class="text-muted glyphicon glyphicon-hdd"></i></a>
<a href="javascript:void(0);" onclick="if(count_valid('meta_note', 'og:description', 80, 160) == true) { meta('save', '<?php echo $information->ic_id; ?>', 'meta_note', $('#meta_note').val()) }"><i class="text-muted glyphicon glyphicon-hdd"></i></a>
<a href="javascript:void(0);" title="为信息添加备注功能."><i class="text-muted glyphicon glyphicon-question-sign"></i></a>
<em class="pull-right muted" id="meta_note_count"></em>
</label>

@ -509,6 +509,14 @@ function get_string_length(str) {
}
return realLength
}
function get_string_length_site(element) {
var length = get_string_length($("#" + element).val());
var sitecode = $("#is_sitecode").val();
if (sitecode == "jp" || sitecode == "ru") {
length = parseInt(length / 2)
}
return length;
}
function change_seo_count(element) {
var length = get_string_length($("#" + element).val());
var sitecode = $("#is_sitecode").val();
@ -528,6 +536,18 @@ function get_ajax_reviewed_list(formid, container, flag) {
}
$("#" + container).load(url + " #" + container, data)
};
function count_valid(element, element_text, from, to) {
if (from <= 0) { return true;}
var element_value_cnt = get_string_length_site(element) ;
if (to > 0 && (element_value_cnt < from || element_value_cnt > to) ) {
$.modaldialog.error(element_text + "长度必须在" + from + "~" + to + "个字符之间")
return false
} else if (to <= 0 && element_value_cnt < from) {
$.modaldialog.error(element_text + "长度必须大于" + from + "个字符")
return false
}
return true;
}
/* basic end*/
function mobile_friendly(refresh){
var ic_url = $("#ic_url").val();

Loading…
Cancel
Save