插入头像 , 粘贴图片 ,插入图片,都要加入域名。防止邮件中出现图片不显示的问题
This commit is contained in:
parent
11abbca1cf
commit
94bffb5458
|
@ -13,7 +13,7 @@ class Kindeditor::AssetsController < ApplicationController
|
||||||
logger.warn '========= Warning: the owner_id is 0, "delete uploaded files automatically" will not work. =========' if defined?(logger) && @asset.owner_id == 0
|
logger.warn '========= Warning: the owner_id is 0, "delete uploaded files automatically" will not work. =========' if defined?(logger) && @asset.owner_id == 0
|
||||||
@asset.asset_type = @dir
|
@asset.asset_type = @dir
|
||||||
if @asset.save
|
if @asset.save
|
||||||
render :text => ({:error => 0, :url => @asset.asset.url,:asset_id => @asset.id}.to_json)
|
render :text => ({:error => 0, :url => "http://"+Setting.host_name + "/" + @asset.asset.url,:asset_id => @asset.id}.to_json)
|
||||||
else
|
else
|
||||||
show_error(@asset.errors.full_messages)
|
show_error(@asset.errors.full_messages)
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,8 @@ module RailsKindeditor
|
||||||
output << text_area_tag(name, content, input_html)
|
output << text_area_tag(name, content, input_html)
|
||||||
output << javascript_tag(js_replace(id, options.merge(window_onload: 'true',
|
output << javascript_tag(js_replace(id, options.merge(window_onload: 'true',
|
||||||
:autoHeightMode=>true,
|
:autoHeightMode=>true,
|
||||||
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})'
|
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})',
|
||||||
|
emotionsBasePath: 'http://' + Setting.host_name
|
||||||
)))
|
)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,7 +22,8 @@ module RailsKindeditor
|
||||||
output_buffer << build_text_area_tag(name, method, self, options, input_html)
|
output_buffer << build_text_area_tag(name, method, self, options, input_html)
|
||||||
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
|
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
|
||||||
:autoHeightMode=>true,
|
:autoHeightMode=>true,
|
||||||
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})'
|
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})',
|
||||||
|
emotionsBasePath: 'http://' + Setting.host_name
|
||||||
)))
|
)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -243,6 +243,7 @@ K.options = {
|
||||||
shadowMode : true,
|
shadowMode : true,
|
||||||
loadStyleMode : true,
|
loadStyleMode : true,
|
||||||
basePath : K.basePath,
|
basePath : K.basePath,
|
||||||
|
emotionsBasePath: 'http://forge.trustie.net', //TODO
|
||||||
themesPath : K.basePath + 'themes/',
|
themesPath : K.basePath + 'themes/',
|
||||||
langPath : K.basePath + 'lang/',
|
langPath : K.basePath + 'lang/',
|
||||||
pluginsPath : K.basePath + 'plugins/',
|
pluginsPath : K.basePath + 'plugins/',
|
||||||
|
@ -5459,6 +5460,7 @@ function _editor(options) {
|
||||||
_instances = [];
|
_instances = [];
|
||||||
function _create(expr, options) {
|
function _create(expr, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
options.emotionsBasePath = _undef(options.emotionsBasePath,'http://forge.trustie.net') // TODO
|
||||||
options.basePath = _undef(options.basePath, K.basePath);
|
options.basePath = _undef(options.basePath, K.basePath);
|
||||||
options.themesPath = _undef(options.themesPath, options.basePath + 'themes/');
|
options.themesPath = _undef(options.themesPath, options.basePath + 'themes/');
|
||||||
options.langPath = _undef(options.langPath, options.basePath + 'lang/');
|
options.langPath = _undef(options.langPath, options.basePath + 'lang/');
|
||||||
|
@ -5623,7 +5625,9 @@ _plugin('core', function(K) {
|
||||||
url:K.addParam('/kindeditor/upload', 'dir=image'),
|
url:K.addParam('/kindeditor/upload', 'dir=image'),
|
||||||
afterUpload : function(data) {
|
afterUpload : function(data) {
|
||||||
if (data.error === 0) {
|
if (data.error === 0) {
|
||||||
var url = K.formatUrl(data.url, 'absolute');
|
|
||||||
|
var url = data.url//K.formatUrl(data.url, 'absolute');
|
||||||
|
// console.log(url)
|
||||||
self.exec('insertimage', url, 'image','','','1','');
|
self.exec('insertimage', url, 'image','','','1','');
|
||||||
//self.exec('insertimage', url, 'image','','','1','left');
|
//self.exec('insertimage', url, 'image','','','1','left');
|
||||||
//self.insertHtml('<img src="'+url+'"/>');
|
//self.insertHtml('<img src="'+url+'"/>');
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
KindEditor.plugin('emoticons', function(K) {
|
KindEditor.plugin('emoticons', function(K) {
|
||||||
var self = this, name = 'emoticons',
|
var self = this, name = 'emoticons',
|
||||||
path = (self.emoticonsPath || self.pluginsPath + 'emoticons/images/'),
|
|
||||||
|
path = self.emotionsBasePath + (self.emoticonsPath || self.pluginsPath + 'emoticons/images/'),
|
||||||
allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons,
|
allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons,
|
||||||
currentPageNum = 1;
|
currentPageNum = 1;
|
||||||
self.clickToolbar(name, function() {
|
self.clickToolbar(name, function() {
|
||||||
|
|
Loading…
Reference in New Issue