增加图形放大缩小功能,优化新建角色模型代码
This commit is contained in:
parent
3ce583eb42
commit
6514facb8c
@ -86,11 +86,6 @@
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../apps/com.actionsoft.apps.cms/css/cms.site.css?v=1655363443943">
|
||||
|
||||
<!--表情选择-->
|
||||
<link href="../apps/com.actionsoft.apps.cms/lib/faceselect/jquery.sinaEmotion.css" rel="stylesheet">
|
||||
<script src="../apps/com.actionsoft.apps.cms/lib/faceselect/jquery.sinaEmotion.js"></script>
|
||||
|
||||
|
||||
|
||||
<!--针对设计器进行颜色扩展,以及文字扩充-->
|
||||
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.userdefined.js'></script>
|
||||
@ -101,7 +96,6 @@
|
||||
<script type="text/javascript" src="../commons/js/jquery/scripts/ui/aws.util.js"></script>
|
||||
<script type='text/javascript' src='../commons/js/public.js'></script>
|
||||
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.cms/js/cms.showsite.js?v=1655363445459"></script>
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.cms/js/cms.util.js?v=1655363445484"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
@ -565,8 +559,18 @@
|
||||
<#js>
|
||||
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.ui.js'></script>
|
||||
<script type='text/javascript' charset='UTF-8' src='../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js'></script>
|
||||
<!-- util -->
|
||||
<script type="text/javascript" charset='UTF-8' src="../apps/com.actionsoft.apps.coe.pal/js/jquery.base64.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/commentFunction.js"></script>
|
||||
|
||||
<!--表情选择-->
|
||||
<link href="../apps/com.actionsoft.apps.coe.pal/css/jquery.sinaEmotion.css" rel="stylesheet">
|
||||
<script src="../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/jquery.sinaEmotion.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript" charset='UTF-8' src="../apps/com.actionsoft.apps.coe.pal/js/jquery.base64.js"></script>
|
||||
<script type="text/javascript" charset='UTF-8' src="../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/util/Base64.js"></script>
|
||||
<!-- biz -->
|
||||
<script type="text/javascript" charset='UTF-8' src="../apps/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.biz.js"></script>
|
||||
@ -575,7 +579,6 @@
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.coe.pal/js/pal.pl.repository.designer.view.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="../apps/com.actionsoft.apps.cms/js/commentFunction.js"></script>
|
||||
|
||||
<#processlink_ete_js>
|
||||
<style type="text/css">
|
||||
@ -854,6 +857,15 @@
|
||||
var newHeight = $(window).height() - $('#toolbarName').height() - $('#tools').height() - 41 - isFile;
|
||||
$("#designer_layout").height(newHeight);
|
||||
})
|
||||
|
||||
function canvasresizeMax() {
|
||||
designerZoom = designerZoom * 1.1;
|
||||
Designer.setZoomScale(designerZoom / 100);
|
||||
}
|
||||
function canvasresizeMin() {
|
||||
designerZoom = designerZoom * 0.9;
|
||||
Designer.setZoomScale(designerZoom / 100);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@ -892,12 +904,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<button name="dock_btn_enlarge" type="button" class="awsui-btn" onclick="canvasresizeMax();">放大</button>
|
||||
<button name="dock_btn_narrow" type="button" class="awsui-btn" onclick="canvasresizeMin();">缩小</button>
|
||||
|
||||
|
||||
<div id="designer">
|
||||
<div id="designer_viewport" class="readonly">
|
||||
<div id="designer_layout" class="" style="background:white;">
|
||||
<div id="canvas_container" style="padding:0px;background-color:white;">
|
||||
<div id="designer_canvas">
|
||||
|
||||
|
||||
<canvas id="designer_grids" style="background-color:white;">您的浏览器不支持HTML5,请使用IE9及以上版本,或Chrome、Firefox等浏览器</canvas>
|
||||
<div class="message-detial-reply">
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,90 @@
|
||||
/*---------- base ---------*/
|
||||
|
||||
#emotions{
|
||||
left:0;
|
||||
width: 420px;
|
||||
font-size:12px;
|
||||
background:#fff;
|
||||
position:absolute;
|
||||
border: 1px solid #E8E8E8;
|
||||
z-index:1;
|
||||
}
|
||||
#emotions a{
|
||||
color: #9ABBC8;
|
||||
padding:2px 5px;
|
||||
text-decoration:none;
|
||||
}
|
||||
.face {
|
||||
background-image: url(add_emoticon.png);
|
||||
background-repeat: no-repeat;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#emotions img{
|
||||
border:0;
|
||||
}
|
||||
#emotions div{
|
||||
margin:5px 10px;
|
||||
padding:1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
#emotions #prev,
|
||||
#emotions #next
|
||||
{
|
||||
margin-left:3px;
|
||||
background:#eee;
|
||||
}
|
||||
#emotions .categorys{
|
||||
height:24px;
|
||||
color: #9ABBC8;
|
||||
overflow:hidden;
|
||||
}
|
||||
#emotions .categorys a{
|
||||
display: inline-block;
|
||||
}
|
||||
#emotions .categorys a:hover{
|
||||
text-decoration:underline;
|
||||
}
|
||||
#emotions .categorys a.current{
|
||||
cursor: default;
|
||||
background: #eee;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
#emotions .container{
|
||||
padding:1px;
|
||||
width:400px;
|
||||
height:200px;
|
||||
overflow: hidden;
|
||||
}
|
||||
#emotions .container a{
|
||||
float:left;
|
||||
width:26px;
|
||||
height:22px;
|
||||
text-align:center;
|
||||
padding: 4px 2px;
|
||||
margin: -1px 0 0 -1px;
|
||||
border: 1px solid #e8e8e8;
|
||||
}
|
||||
#emotions .container a:hover{
|
||||
z-index:2;
|
||||
position:relative;
|
||||
border:1px solid #0095cd;
|
||||
}
|
||||
#emotions .page{
|
||||
text-align:right;
|
||||
}
|
||||
#emotions .page a.current{
|
||||
color: #666;
|
||||
background-color:#fff;
|
||||
}
|
||||
#emotions .page a{
|
||||
margin-left:3px;
|
||||
color: #0078B6;
|
||||
background-color:#f3f3f3;
|
||||
}
|
||||
#emotions .page a:hover{
|
||||
background-color:#e7e7e7;
|
||||
}
|
||||
@ -254,6 +254,7 @@ function previewBox_to_chartDiv(){
|
||||
}
|
||||
|
||||
function resizeMin(){
|
||||
debugger;
|
||||
if (!checkHtml5()) {
|
||||
var currentW = $("#chartDiv").width();
|
||||
var currentH = $("#chartDiv").height();
|
||||
@ -285,7 +286,7 @@ function resizeMin(){
|
||||
}
|
||||
|
||||
function resizeMax(){
|
||||
if (!checkHtml5()) {
|
||||
if (!checkHtmld5()) {
|
||||
var currentW = $("#chartDiv").width();
|
||||
var currentH = $("#chartDiv").height();
|
||||
var imgW = $("#chartDiv").find("img").width();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -3429,7 +3429,6 @@ function getRelevanceAwsOrgNameByShapeId(objIds, shapeId) {
|
||||
|
||||
// 形状关联弹窗
|
||||
function openRelationDig(obj,value) {
|
||||
|
||||
var shapeRelationValue = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").val();
|
||||
var ref = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").attr("ref"); // shape file shapeAndFile
|
||||
var relationShapeIds = '';
|
||||
@ -3462,117 +3461,145 @@ function openRelationDig(obj,value) {
|
||||
+ "&relationFileIds=" + relationFileIds
|
||||
+ "&ruuid=" + ruuid);
|
||||
|
||||
//根据角色
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role",
|
||||
data : {
|
||||
uuid:ruuid,
|
||||
methodId:methodId
|
||||
},
|
||||
success : function(msg) {
|
||||
|
||||
|
||||
if (msg.data.result == "ok" ) {
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
||||
buttons : [
|
||||
{
|
||||
text : '确定',
|
||||
cls : "blue",
|
||||
handler : function() {
|
||||
var tmpObjId = $(obj).attr("objid");
|
||||
getRelevanceShapes(tmpObjId,value);
|
||||
var tmpShape = Utils.getSelected()[0];
|
||||
var tmpTitle = tmpShape.title;
|
||||
if (tmpShape.name == "linker") {
|
||||
return;
|
||||
}
|
||||
if (tmpTitle.indexOf("泳道") > -1 || tmpTitle.indexOf("泳池") > -1 || tmpTitle.indexOf("分隔") > -1) {
|
||||
return;
|
||||
}
|
||||
if (isForceShowError && tmpAttrIdValue.indexOf(tmpObjId) > -1) {
|
||||
$.simpleAlert("已设置不允许修改,请在应用参数中设置", 'error');
|
||||
isForceShowError = false;
|
||||
}
|
||||
tmpAttrIdValue = [];
|
||||
}
|
||||
}, {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog('close');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}else{
|
||||
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
||||
buttons : [
|
||||
{
|
||||
text : '刷新',
|
||||
cls : "yellow",
|
||||
handler : function() {
|
||||
// 刷新页面
|
||||
document.getElementById("attr_content_iframe_relevance_shapes").contentWindow.location.reload(true);
|
||||
}
|
||||
},{
|
||||
text : "新建角色模型",
|
||||
cls : "green",
|
||||
handler : function() {
|
||||
//跳转角色
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel",
|
||||
data : {
|
||||
uuid:ruuid,
|
||||
methodId:methodId
|
||||
},
|
||||
success : function(msg) {
|
||||
if (msg.result == "ok") {
|
||||
window.open("./w?uuid=" + msg.data.uuid+"&teamId"
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid=" + encodeURIComponent($('#sid').val()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(methodId=="org.role"){
|
||||
//根据角色
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role",
|
||||
data : {
|
||||
uuid:ruuid,
|
||||
methodId:methodId
|
||||
},
|
||||
success : function(msg) {
|
||||
if (msg.data.result == "ok" ) {
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
||||
buttons : [
|
||||
{
|
||||
text : '确定',
|
||||
cls : "blue",
|
||||
handler : function() {
|
||||
var tmpObjId = $(obj).attr("objid");
|
||||
getRelevanceShapes(tmpObjId,value);
|
||||
var tmpShape = Utils.getSelected()[0];
|
||||
var tmpTitle = tmpShape.title;
|
||||
if (tmpShape.name == "linker") {
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
text : '确定',
|
||||
cls : "blue",
|
||||
handler : function() {
|
||||
var tmpObjId = $(obj).attr("objid");
|
||||
getRelevanceShapes(tmpObjId,value);
|
||||
var tmpShape = Utils.getSelected()[0];
|
||||
var tmpTitle = tmpShape.title;
|
||||
if (tmpShape.name == "linker") {
|
||||
return;
|
||||
if (tmpTitle.indexOf("泳道") > -1 || tmpTitle.indexOf("泳池") > -1 || tmpTitle.indexOf("分隔") > -1) {
|
||||
return;
|
||||
}
|
||||
if (isForceShowError && tmpAttrIdValue.indexOf(tmpObjId) > -1) {
|
||||
$.simpleAlert("已设置不允许修改,请在应用参数中设置", 'error');
|
||||
isForceShowError = false;
|
||||
}
|
||||
tmpAttrIdValue = [];
|
||||
}
|
||||
if (tmpTitle.indexOf("泳道") > -1 || tmpTitle.indexOf("泳池") > -1 || tmpTitle.indexOf("分隔") > -1) {
|
||||
return;
|
||||
}, {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog('close');
|
||||
}
|
||||
if (isForceShowError && tmpAttrIdValue.indexOf(tmpObjId) > -1) {
|
||||
$.simpleAlert("已设置不允许修改,请在应用参数中设置", 'error');
|
||||
isForceShowError = false;
|
||||
}
|
||||
tmpAttrIdValue = [];
|
||||
}
|
||||
}, {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog('close');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}]
|
||||
});
|
||||
}else{
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
||||
buttons : [
|
||||
{
|
||||
text : '刷新',
|
||||
cls : "yellow",
|
||||
handler : function() {
|
||||
// 刷新页面
|
||||
document.getElementById("attr_content_iframe_relevance_shapes").contentWindow.location.reload(true);
|
||||
}
|
||||
},{
|
||||
text : "新建角色模型",
|
||||
cls : "green",
|
||||
handler : function() {
|
||||
//跳转角色
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd?sid="
|
||||
+ CLB.sid
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel",
|
||||
data : {
|
||||
uuid:ruuid,
|
||||
methodId:methodId
|
||||
},
|
||||
success : function(msg) {
|
||||
if (msg.result == "ok") {
|
||||
window.open("./w?uuid=" + msg.data.uuid+"&teamId"
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid=" + encodeURIComponent($('#sid').val()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
text : '确定',
|
||||
cls : "blue",
|
||||
handler : function() {
|
||||
var tmpObjId = $(obj).attr("objid");
|
||||
getRelevanceShapes(tmpObjId,value);
|
||||
var tmpShape = Utils.getSelected()[0];
|
||||
var tmpTitle = tmpShape.title;
|
||||
if (tmpShape.name == "linker") {
|
||||
return;
|
||||
}
|
||||
if (tmpTitle.indexOf("泳道") > -1 || tmpTitle.indexOf("泳池") > -1 || tmpTitle.indexOf("分隔") > -1) {
|
||||
return;
|
||||
}
|
||||
if (isForceShowError && tmpAttrIdValue.indexOf(tmpObjId) > -1) {
|
||||
$.simpleAlert("已设置不允许修改,请在应用参数中设置", 'error');
|
||||
isForceShowError = false;
|
||||
}
|
||||
tmpAttrIdValue = [];
|
||||
}
|
||||
}, {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog('close');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog({
|
||||
buttons : [
|
||||
{
|
||||
text : '确定',
|
||||
cls : "blue",
|
||||
handler : function() {
|
||||
var tmpObjId = $(obj).attr("objid");
|
||||
getRelevanceShapes(tmpObjId,value);
|
||||
var tmpShape = Utils.getSelected()[0];
|
||||
var tmpTitle = tmpShape.title;
|
||||
if (tmpShape.name == "linker") {
|
||||
return;
|
||||
}
|
||||
if (tmpTitle.indexOf("泳道") > -1 || tmpTitle.indexOf("泳池") > -1 || tmpTitle.indexOf("分隔") > -1) {
|
||||
return;
|
||||
}
|
||||
if (isForceShowError && tmpAttrIdValue.indexOf(tmpObjId) > -1) {
|
||||
$.simpleAlert("已设置不允许修改,请在应用参数中设置", 'error');
|
||||
isForceShowError = false;
|
||||
}
|
||||
tmpAttrIdValue = [];
|
||||
}
|
||||
}, {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
$("#attr_dialog_normal_relevance_shapes_div").dialog('close');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 将关联关系保存到数据库
|
||||
|
||||
@ -0,0 +1,252 @@
|
||||
/**
|
||||
* @time 2012-12-14
|
||||
*/
|
||||
|
||||
//自定义hashtable
|
||||
function Hashtable() {
|
||||
this._hash = new Object();
|
||||
this.put = function(key, value) {
|
||||
if (typeof (key) != "undefined") {
|
||||
if (this.containsKey(key) == false) {
|
||||
this._hash[key] = typeof (value) == "undefined" ? null : value;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
this.remove = function(key) { delete this._hash[key]; };
|
||||
this.size = function() { var i = 0; for (var k in this._hash) { i++; } return i; };
|
||||
this.get = function(key) { return this._hash[key]; };
|
||||
this.containsKey = function(key) { return typeof (this._hash[key]) != "undefined"; };
|
||||
this.clear = function() { for (var k in this._hash) { delete this._hash[k]; } };
|
||||
}
|
||||
|
||||
var emotions = new Array();
|
||||
var categorys = new Array();// 分组
|
||||
var categorys_big5 = new Array();// 分组
|
||||
var categorys_en = new Array();// 分组
|
||||
var uSinaEmotionsHt = new Hashtable();
|
||||
|
||||
|
||||
// 初始化缓存,页面仅仅加载一次就可以了
|
||||
|
||||
$(function() {
|
||||
$.getJSON("../apps/com.actionsoft.apps.cms/lib/faceselect/nativeface.json", function(response) {
|
||||
var data = response;
|
||||
for (var i in data) {
|
||||
if (data[i].category == '') {
|
||||
data[i].category = '默认';
|
||||
}
|
||||
var arr= data[i].category;
|
||||
|
||||
if(language=="cn"){
|
||||
arr= data[i].category;
|
||||
}else if(language=="big5"){
|
||||
arr= data[i].category_big5;
|
||||
}else if(language=="en"){
|
||||
arr= data[i].category_en;
|
||||
}else{
|
||||
arr= data[i].category;
|
||||
}
|
||||
if(arr!=undefined){
|
||||
if (emotions[arr] == undefined) {
|
||||
emotions[arr] = new Array();
|
||||
categorys.push(arr);
|
||||
/*
|
||||
if(language=="cn"){
|
||||
categorys.push(data[i].category);
|
||||
}else if(language=="big5"){
|
||||
categorys_big5.push(data[i].category_big5);
|
||||
}else if(language=="en"){
|
||||
categorys_en.push(data[i].category_en);
|
||||
}else{
|
||||
categorys.push(data[i].category);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
/*
|
||||
emotions[data[i].category].push({
|
||||
name : data[i].phrase,
|
||||
icon : data[i].url
|
||||
});
|
||||
*/
|
||||
|
||||
if(language=="cn"){
|
||||
emotions[data[i].category].push({
|
||||
name : data[i].phrase,
|
||||
icon : data[i].url
|
||||
});
|
||||
}else if(language=="big5"){
|
||||
emotions[data[i].category_big5].push({
|
||||
name : data[i].phrase,
|
||||
icon : data[i].url
|
||||
});
|
||||
}else if(language=="en"){
|
||||
emotions[data[i].category_en].push({
|
||||
name : data[i].phrase,
|
||||
icon : data[i].url
|
||||
});
|
||||
}else{
|
||||
emotions[data[i].category].push({
|
||||
name : data[i].phrase,
|
||||
icon : data[i].url
|
||||
});
|
||||
}
|
||||
|
||||
uSinaEmotionsHt.put(data[i].phrase, data[i].url);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
//替换
|
||||
function AnalyticEmotion(s) {
|
||||
if(typeof (s) != "undefined") {
|
||||
var sArr = s.match(/\[.*?\]/g);
|
||||
if (sArr != null) {//只有当字符串中包含[]
|
||||
for (var i = 0; i < sArr.length; i++) {
|
||||
if (uSinaEmotionsHt.containsKey(sArr[i])) {
|
||||
var reStr = "<img src=\"" + uSinaEmotionsHt.get(sArr[i]) + "\" height=\"22\" width=\"22\" />";
|
||||
s = s.replace(sArr[i], reStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
(function($){
|
||||
$.fn.SinaEmotion = function(target,sort){
|
||||
var cat_current;
|
||||
var cat_page;
|
||||
$(this).click(function(event){
|
||||
event.stopPropagation();
|
||||
|
||||
var eTop = target.offset().top + 15;
|
||||
var eLeft = target.offset().left - 1;
|
||||
|
||||
if($('#emotions .categorys')[0]){
|
||||
$('#emotions').css({top: eTop, left: eLeft});
|
||||
$('#emotions').toggle();
|
||||
return;
|
||||
}
|
||||
$(this).parent().append('<div id="emotions"></div>');
|
||||
$('#emotions').css({top: eTop, left: eLeft});
|
||||
$('#emotions').html('<div>正在加载,请稍候...</div>');
|
||||
$('#emotions').click(function(event){
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
$('#emotions').html('<div style="float:right"><a href="javascript:void(0);" id="prev">«</a><a href="javascript:void(0);" id="next">»</a></div><div class="categorys"></div><div class="container"></div><div class="page"></div>');
|
||||
$('#emotions #prev').click(function(){
|
||||
showCategorys(cat_page - 1);
|
||||
});
|
||||
$('#emotions #next').click(function(){
|
||||
showCategorys(cat_page + 1);
|
||||
});
|
||||
|
||||
if(sort=="1"){
|
||||
$('#emotions').css("top","0px");
|
||||
$('#emotions').css("left","0px");
|
||||
$('#emotions').css({top: 0, left: 0});
|
||||
}
|
||||
showCategorys();
|
||||
showEmotions();
|
||||
|
||||
});
|
||||
$('body').click(function(){
|
||||
$('#emotions').remove();
|
||||
});
|
||||
$.fn.insertText = function(text){
|
||||
this.each(function() {
|
||||
if(this.tagName !== 'INPUT' && this.tagName !== 'TEXTAREA') {return;}
|
||||
if (document.selection) {
|
||||
this.focus();
|
||||
var cr = document.selection.createRange();
|
||||
cr.text = text;
|
||||
cr.collapse();
|
||||
cr.select();
|
||||
}else if (this.selectionStart || this.selectionStart == '0') {
|
||||
var
|
||||
start = this.selectionStart,
|
||||
end = this.selectionEnd;
|
||||
this.value = this.value.substring(0, start)+ text+ this.value.substring(end, this.value.length);
|
||||
this.selectionStart = this.selectionEnd = start+text.length;
|
||||
}else {
|
||||
this.value += text;
|
||||
}
|
||||
});
|
||||
return this;
|
||||
}
|
||||
function showCategorys(){
|
||||
var page = arguments[0]?arguments[0]:0;
|
||||
if(page < 0 || page >= categorys.length / 5){
|
||||
return;
|
||||
}
|
||||
$('#emotions .categorys').html('');
|
||||
cat_page = page;
|
||||
for(var i = page * 5; i < (page + 1) * 5 && i < categorys.length; ++i){
|
||||
var catname = categorys[i];
|
||||
/*
|
||||
if(language=="cn"){
|
||||
catname = categorys[i];
|
||||
}else if(language=="big5"){
|
||||
catname = categorys_big5[i];
|
||||
}else if(language=="en"){
|
||||
catname = categorys_en[i];
|
||||
}else{
|
||||
catname = categorys[i];
|
||||
}
|
||||
*/
|
||||
|
||||
$('#emotions .categorys').append($('<a href="javascript:void(0);">' + catname + '</a>'));
|
||||
}
|
||||
$('#emotions .categorys a').click(function(){
|
||||
showEmotions($(this).text());
|
||||
});
|
||||
$('#emotions .categorys a').each(function(){
|
||||
if($(this).text() == cat_current){
|
||||
$(this).addClass('current');
|
||||
}
|
||||
});
|
||||
}
|
||||
function showEmotions(){
|
||||
var category = arguments[0]?arguments[0]:categorys[0];
|
||||
var page = arguments[1]?arguments[1] - 1:0;
|
||||
$('#emotions .container').html('');
|
||||
$('#emotions .page').html('');
|
||||
cat_current = category;
|
||||
for(var i = page * 72; i < (page + 1) * 72 && i < emotions[category].length; ++i){
|
||||
$('#emotions .container').append($('<a href="javascript:void(0);" awsui-qtip="' + emotions[category][i].name + '" atitle="' + emotions[category][i].name + '" ><img src="' + emotions[category][i].icon + '" alt="' + emotions[category][i].name + '" width="22" height="22" /></a>'));
|
||||
}
|
||||
$('#emotions .container a').click(function(){
|
||||
target.insertText($(this).attr('atitle'));
|
||||
$('#emotions').remove();
|
||||
$("#awsui_quicktip").hide();//隐藏提示 awsui_qtip 解决点击消失不了
|
||||
});
|
||||
for(var i = 1; i < emotions[category].length / 72 + 1; ++i){
|
||||
$('#emotions .page').append($('<a href="javascript:void(0);"' + (i == page + 1?' class="current"':'') + '>' + i + '</a>'));
|
||||
}
|
||||
$('#emotions .page a').click(function(){
|
||||
showEmotions(category, $(this).text());
|
||||
});
|
||||
$('#emotions .categorys a.current').removeClass('current');
|
||||
$('#emotions .categorys a').each(function(){
|
||||
if($(this).text() == category){
|
||||
$(this).addClass('current');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
||||
Loading…
Reference in New Issue
Block a user