AngularJSパッケージUuditor
詳細
ueditor
//
var app = angular.module("ueditorApp", [ 'ngSanitize' ]);
//
app.directive('zueditor', function() {
var option = {
restrict : 'E',
require : '?ngModel',
replace : true,
template : '<div></div>',
scope : true,
link : function($scope, $element, $attrs, ngModel) {
var id = $attrs.id;
var ue = UE.getEditor(id, {
toolbars : [ [ 'bold', 'italic', 'underline', 'fontsize',
'forecolor', 'justifyleft', 'justifycenter',
'justifyright', 'simpleupload', 'insertimage',
'attachment', 'removeformat', 'fullscreen' ] ],
autoHeightEnabled : true,
autoFloatEnabled : true
});
ue.addListener("contentChange", function() {
//
$scope.$emit('sendtext', ue.getContent());
});
}
};
return option;
});
//
app.directive('zueditorsimple', function() {
var option = {
restrict : 'E',
replace : true,
template : '<div></div>',
scope : true,
link : function($scope, $element, $attrs) {
var id = $attrs.id;
var ue = UE.getEditor(id, {
toolbars : [ [ 'bold', 'italic', 'underline', 'fontsize',
'forecolor', 'justifyleft', 'justifycenter',
'justifyright', 'removeformat', 'fullscreen' ] ],
autoHeightEnabled : true,
autoFloatEnabled : true
});
ue.addListener("contentChange", function() {
$scope.$emit('sendtext', ue.getContentTxt());
});
}
};
return option;
});
app.controller("uCtrl", function($scope, $http) {
$scope.editor = "";
$scope.content = "";
$scope.$on("sendParent", function(event, data) {
$scope.content = data;
});
$scope.save = function() {
alert($scope.content);
};
});</pre>
<div class="attachments">
<ul>
<li>UEditor.zip (1.7 MB)</li>
<li> : 2</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!--PC WAP -->
<div id="SOHUCS" sid="1176408005818789888"></div>
<script type="text/javascript" src="/views/front/js/chanyan.js">