add bower support
This commit is contained in:
.gitignorebower.json
dist
CHANGELOG.txtLICENSE-MITREADME.md
bootstrap-editable
inputs-ext
address
wysihtml5
jquery-editable
css
img
jquery-ui-datepicker
css
redmond
images
animated-overlay.gifui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_55_fbec88_40x100.pngui-bg_glass_75_d0e5f5_1x400.pngui-bg_glass_85_dfeffc_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_gloss-wave_55_5c9ccc_500x100.pngui-bg_inset-hard_100_f5f8f9_1x100.pngui-bg_inset-hard_100_fcfdfd_1x100.pngui-icons_217bc0_256x240.pngui-icons_2e83ff_256x240.pngui-icons_469bdd_256x240.pngui-icons_6da8d5_256x240.pngui-icons_cd0a0a_256x240.pngui-icons_d8e7f3_256x240.pngui-icons_f9bd01_256x240.png
jquery-ui-1.10.2.custom.cssjquery-ui-1.10.2.custom.min.cssjs
js
jqueryui-editable
124
dist/inputs-ext/wysihtml5/wysihtml5.js
vendored
Normal file
124
dist/inputs-ext/wysihtml5/wysihtml5.js
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
/**
|
||||
Bootstrap wysihtml5 editor. Based on [bootstrap-wysihtml5](https://github.com/jhollingworth/bootstrap-wysihtml5).
|
||||
You should include this input **manually** with dependent js and css files from `inputs-ext` directory.
|
||||
|
||||
<link href="js/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/bootstrap-wysihtml5-0.0.2.css" rel="stylesheet" type="text/css"></link>
|
||||
<script src="js/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/wysihtml5-0.3.0.min.js"></script>
|
||||
<script src="js/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/bootstrap-wysihtml5-0.0.2.min.js"></script>
|
||||
<script src="js/inputs-ext/wysihtml5/wysihtml5.js"></script>
|
||||
|
||||
**Note:** It's better to use fresh bootstrap-wysihtml5 from it's [master branch](https://github.com/jhollingworth/bootstrap-wysihtml5/tree/master/src) as there is update for correct image insertion.
|
||||
|
||||
@class wysihtml5
|
||||
@extends abstractinput
|
||||
@final
|
||||
@since 1.4.0
|
||||
@example
|
||||
<div id="comments" data-type="wysihtml5" data-pk="1"><h2>awesome</h2> comment!</div>
|
||||
<script>
|
||||
$(function(){
|
||||
$('#comments').editable({
|
||||
url: '/post',
|
||||
title: 'Enter comments'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
**/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
var Wysihtml5 = function (options) {
|
||||
this.init('wysihtml5', options, Wysihtml5.defaults);
|
||||
|
||||
//extend wysihtml5 manually as $.extend not recursive
|
||||
this.options.wysihtml5 = $.extend({}, Wysihtml5.defaults.wysihtml5, options.wysihtml5);
|
||||
};
|
||||
|
||||
$.fn.editableutils.inherit(Wysihtml5, $.fn.editabletypes.abstractinput);
|
||||
|
||||
$.extend(Wysihtml5.prototype, {
|
||||
render: function () {
|
||||
var deferred = $.Deferred(),
|
||||
msieOld;
|
||||
|
||||
//generate unique id as it required for wysihtml5
|
||||
this.$input.attr('id', 'textarea_'+(new Date()).getTime());
|
||||
|
||||
this.setClass();
|
||||
this.setAttr('placeholder');
|
||||
|
||||
//resolve deffered when widget loaded
|
||||
$.extend(this.options.wysihtml5, {
|
||||
events: {
|
||||
load: function() {
|
||||
deferred.resolve();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.$input.wysihtml5(this.options.wysihtml5);
|
||||
|
||||
/*
|
||||
In IE8 wysihtml5 iframe stays on the same line with buttons toolbar (inside popover).
|
||||
The only solution I found is to add <br>. If you fine better way, please send PR.
|
||||
*/
|
||||
msieOld = /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase());
|
||||
if(msieOld) {
|
||||
this.$input.before('<br><br>');
|
||||
}
|
||||
|
||||
return deferred.promise();
|
||||
},
|
||||
|
||||
value2html: function(value, element) {
|
||||
$(element).html(value);
|
||||
},
|
||||
|
||||
html2value: function(html) {
|
||||
return html;
|
||||
},
|
||||
|
||||
value2input: function(value) {
|
||||
this.$input.data("wysihtml5").editor.setValue(value, true);
|
||||
},
|
||||
|
||||
activate: function() {
|
||||
this.$input.data("wysihtml5").editor.focus();
|
||||
}
|
||||
});
|
||||
|
||||
Wysihtml5.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
|
||||
/**
|
||||
@property tpl
|
||||
@default <textarea></textarea>
|
||||
**/
|
||||
tpl:'<textarea></textarea>',
|
||||
/**
|
||||
@property inputclass
|
||||
@default editable-wysihtml5
|
||||
**/
|
||||
inputclass: 'editable-wysihtml5',
|
||||
/**
|
||||
Placeholder attribute of input. Shown when input is empty.
|
||||
|
||||
@property placeholder
|
||||
@type string
|
||||
@default null
|
||||
**/
|
||||
placeholder: null,
|
||||
/**
|
||||
Wysihtml5 default options.
|
||||
See https://github.com/jhollingworth/bootstrap-wysihtml5#options
|
||||
|
||||
@property wysihtml5
|
||||
@type object
|
||||
@default {stylesheets: false}
|
||||
**/
|
||||
wysihtml5: {
|
||||
stylesheets: false //see https://github.com/jhollingworth/bootstrap-wysihtml5/issues/183
|
||||
}
|
||||
});
|
||||
|
||||
$.fn.editabletypes.wysihtml5 = Wysihtml5;
|
||||
|
||||
}(window.jQuery));
|
Reference in New Issue
Block a user