vesh-vj
Version:
VESH's JavaScript Framework
164 lines (160 loc) • 4.69 kB
HTML
<html>
<head>
<meta name="renderer" content="webkit" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="Add multi-touch gestures to your webpage.">
<title>VJ test</title>
<script src="../../../2.0/ref/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="../../../2.0/VJ.js" type="text/javascript"></script>
<script src="config.js" type="text/javascript"></script>
<script src="../../../ni.js" type="text/javascript"></script>
<style type="text/css">
.animate {
transition: all 0.3s;
-webkit-animation-timing-function: ease;
}
.htmlc-control{
position:absolute;
width: 408px;
height:300px;
left:400px;
top:200px;
display:none;
background-color:lightcoral;
}
.htmlc-control-se{
padding-left: 20px;
/* line-height: 30px; */
margin-top: 20px;
}
.htmlc-control ul{
list-style: none;
width:100%;
display: inline-block;
height: auto;
}
.htmlc-control-urls ul li {
height: 27px;
}
.htmlc-control-urls ul li {
height: 27px;
}
.htmlc-control li input[type=text]{
width:50px;
}
.htmlc-control li input[type=button]{
margin-left:10px;
}
.htmlc-control ul[datarole=style] li,ul[datarole=attrs] li{
width:100px;
float:left;
height:11px;
}
.htmlc-control-buttons{
position: absolute;
bottom: 15px;
margin: 0 auto;
}
.htmlc-control-save{
padding-left: 18px;
background-image: url('images/submit.gif');
background-size: 16;
border-radius: 8px;
margin-left: 100px;
background-repeat: no-repeat;
}
.htmlc-control-delete{
padding-left: 18px;
background-image: url('images/del.png');
background-size: 16;
border-radius: 8px;
margin-left: 15px;
background-repeat: no-repeat;
}
.htmlc-control-cancel{
padding-left: 16px;
background-image: url('images/cancel.gif');
background-size: 14px;
border-radius: 8px;
margin-left: 15px;
background-repeat: no-repeat;
}
.htmlc-control ul .addline{
padding-left: 20px;
background-image: url('images/add.jpg');
background-size: 16px;
border-radius: 8px;
background-repeat: no-repeat;
}
.htmlc-control ul .deleteone{
padding-left: 20px;
background-image: url('images/delete.jpg');
background-size: 16px;
border-radius: 8px;
background-repeat: no-repeat;
}
#preview {border:solid 1px black;}
</style>
<script type="text/javascript">
(function(V,M,$,cm,W){
new function(){
var _=this,__={};
{
cm = V.merge(cm,{
Middler:{
'VESH.view':{
editor:{path:'../../control/ueditor/ueditor.config.js;../../control/ueditor/ueditor.all.min.js;../../control/ueditor/lang/zh-cn/zh-cn.js;../../control/ueditor/ueditor.js',params:["",{data:{debug:true}}]},
shower:{path:'../../control/ueditor/textshower.css;../../control/ueditor/textshower.js',params:["",{data:{debug:true}}]},
}
}
});
V.isDebug = true;
V.inherit.apply(_,[M.Page,[cm,{
editor:{
data:{value:'<p><img src="dialogs/input/input.png" id="prop_address" _type="text" _data="{"id":"prop_address","type":"text","length":"10","selGloble":"prop_address"}"/>2222</p>',width1:'4000px1'},
onLoad:function(D,I){
I.update({value1:'<img src="http://www.sohu.com/upload/images20140108/sohulogo.png" _id="223" _href="abcde" _type="text"/><input type="text"/>'});
}
},
bunPre:{
onClick:function(D,I){
var val = this.editor.get().value;
this.preview.update({template:val,value:_.page.data.val});
}
},
bunVal:{
onClick:function(D,I){
var val = this.preview.get().value;
_.page.data.val = val;
alert(V.toJsonString(val));
}
},
page:{
data:{
title:'editor',
val:{}
},
onStart:function(D,I){
V.callEvent('test.resize',[{width:V.userAgent.width,height:V.userAgent.height}]);
},
onSize:function(D,I){
console.log('resize');
V.callEvent('test.resize',[{width:D.width,height:D.height}]);
}
}
}]]);
}
};
})(VJ,VJ.viewmodel,jQuery,window.top.config,VJ.view);
</script>
</head>
<body>
<editor _="" id="editor" ></editor>
<button id="bunPre" _="value:'预览'"></button>
<button id="bunVal" _="value:'取值'"></button>
<div id="preview" _="type:'shower',value:''"></div>
</body>
</html>