diff --git a/assets/dist/scripts/charcoal.admin.js b/assets/dist/scripts/charcoal.admin.js
index db602f9dc0..df73864c68 100644
--- a/assets/dist/scripts/charcoal.admin.js
+++ b/assets/dist/scripts/charcoal.admin.js
@@ -1340,6 +1340,7 @@ Charcoal.Admin.Widget = function (opts) {
if (typeof opts.id === 'string') {
this.set_element($('#' + opts.id));
this.set_id(opts.id);
+ this.widget_id = opts.widget_id || opts.id;
}
if (typeof opts.type === 'string') {
@@ -1363,13 +1364,27 @@ Charcoal.Admin.Widget.prototype.set_opts = function (opts) {
return this;
};
+/**
+ * Add option
+ * @param {String} ident
+ * @param {Mixed} val
+ * @return this (chainable)
+ */
+Charcoal.Admin.Widget.prototype.add_opts = function (ident, val) {
+ if (typeof ident === 'string') {
+ this._opts[ident] = val;
+ }
+
+ return this;
+};
+
/**
* If a ident is specified, the method tries to return
* the options pointed out.
* If no ident is specified, the method returns
* the whole opts object
*
- * @param {String} ident | falcultative
+ * @param {String} [ident]
* @return {Object|Mixed|false}
*/
Charcoal.Admin.Widget.prototype.opts = function (ident) {
@@ -1497,7 +1512,11 @@ Charcoal.Admin.Widget.prototype.reload = function (callback) {
contentType: 'application/json',
success: function (response) {
if (typeof response.widget_id === 'string') {
- that.set_id(response.widget_id);
+ var wid = response.widget_id;
+ that.set_id(wid);
+ that.add_opts('id', wid);
+ that.add_opts('widget_id', wid);
+ that.widget_id = wid;
that.anim_out(function () {
that.element().replaceWith(response.widget_html);
that.set_element($('#' + that.id()));
@@ -3474,8 +3493,8 @@ Charcoal.Admin.Widget_Table.prototype.bind_events = function ()
}
}).disableSelection();
- $('.js-page-switch').on('click', function (e) {
- e.preventDefault();
+ $('.js-page-switch', that.table_selector).on('click', function (event) {
+ event.preventDefault();
var $this = $(this);
var page_num = $this.data('page-num');
diff --git a/assets/dist/scripts/charcoal.admin.min.js b/assets/dist/scripts/charcoal.admin.min.js
index 88089cb115..398c46d5f2 100644
--- a/assets/dist/scripts/charcoal.admin.min.js
+++ b/assets/dist/scripts/charcoal.admin.min.js
@@ -1,6 +1,6 @@
-/*! @locomotivemtl/charcoal-admin 27-09-2017 */
+/*! @locomotivemtl/charcoal-admin 05-10-2017 */
-$.fn.enable=function(){return this.each(function(){$(this).removeAttr("disabled").prop("disabled",!1)}),this},$.fn.disable=function(){return this.each(function(){$(this).attr("disabled",!0).prop("disabled",!0)}),this},RegExp.escape||(RegExp.escape=function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(a){if(null==this)throw new TypeError('"this" is null or not defined');if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var b=Object(this),c=b.length>>>0,d=arguments[1],e=0;e
")+"
",type:b.type,buttons:c})}return this.empty(),this},k.prototype.call=k.prototype.dispatch,k.prototype.empty=function(){i(),this.actions=[],this.storage=[]},k.prototype.reset=k.prototype.empty;var l=function(a,c){if(b.feedback(),!this.validLevel(a))throw new TypeError("Feedback level required. Must be one of: "+e.join(", "));return this.setLevel(a),this.validMessage(c)&&this.setMessage(c),this};l.createFromObject=function(a){var b=a.level||null,c=a.message||a.msg||null;return b||c?new l(b,c):null},l.prototype={toString:function(){return this.message()},level:function(){return this._level||null},setLevel:function(b){var c=a.type(b);if("string"!==c)throw new TypeError("Feedback level must be a string, received "+c);if(-1===a.inArray(b,e))throw new TypeError('Unsupported feedback level, received "'+b+'". Must be one of: '+e.join(", "));return b in g&&(b=g[b]),this._level=b,this},validLevel:function(b){return"string"===a.type(b)&&a.inArray(b,e)>-1},message:function(){return this._message||null},setMessage:function(b){var c=a.type(b);if("string"!==c)throw new TypeError("Feedback message must be a string, received "+c);return this._message=b,this},validMessage:function(b){return"string"===a.type(b)}},i(),b.Feedback=k,b.FeedbackEntry=l}(jQuery,Charcoal.Admin,document),Charcoal.Admin.Widget=function(a){return this._element=void 0,this._id=void 0,this._type=void 0,this._opts=void 0,a?("string"==typeof a.id&&(this.set_element($("#"+a.id)),this.set_id(a.id)),"string"==typeof a.type&&(this.set_type(a.type),this.widget_type=a.widget_type||a.type),this.set_opts(a),this):this},Charcoal.Admin.Widget.prototype.set_opts=function(a){return this._opts=a,this},Charcoal.Admin.Widget.prototype.opts=function(a){return"string"==typeof a?void 0!==this._opts[a]&&this._opts[a]:this._opts},Charcoal.Admin.Widget.prototype.init=function(){return this},Charcoal.Admin.Widget.prototype.set_id=function(a){this._id=a},Charcoal.Admin.Widget.prototype.id=function(){return this._id},Charcoal.Admin.Widget.prototype.set_type=function(a){this._type=a},Charcoal.Admin.Widget.prototype.type=function(){return this._type},Charcoal.Admin.Widget.prototype.set_element=function(a){return this._element=a,this},Charcoal.Admin.Widget.prototype.element=function(){return this._element},Charcoal.Admin.Widget.prototype.widget_options=function(){return this.opts()},Charcoal.Admin.Widget.prototype.widget_type=function(){return this.type()},Charcoal.Admin.Widget.prototype.save=function(){return!0},Charcoal.Admin.Widget.prototype.anim_out=function(a){return"function"!=typeof a&&(a=function(){}),this.element().fadeOut(400,a),this},Charcoal.Admin.Widget.prototype.reload=function(a){var b=this,c=Charcoal.Admin.admin_url()+"widget/load",d={widget_type:b.widget_type||b.type(),widget_options:b.widget_options()};$.ajax({type:"POST",url:c,data:JSON.stringify(d),dataType:"json",contentType:"application/json",success:function(c){"string"==typeof c.widget_id&&(b.set_id(c.widget_id),b.anim_out(function(){b.element().replaceWith(c.widget_html),b.set_element($("#"+b.id())),b.element().hide().fadeIn(),b.init()})),"function"==typeof a&&a.call(b,c)}})},Charcoal.Admin.Widget.prototype.dialog=function(a,b){var c=a.title||"",d=a.type||BootstrapDialog.TYPE_DEFAULT,e=a.size||BootstrapDialog.SIZE_NORMAL,f=a.cssClass||"",g=a.showHeader||!0,h=a.showFooter||!0,i=a.dialog_options||{};delete a.title,delete a.type,delete a.size,delete a.cssClass,delete a.dialog_options;var j={title:c,type:d,size:e,cssClass:f,nl2br:!1,showHeader:g,showFooter:h,onshown:function(){Charcoal.Admin.manager().render()}},k=$.extend({},j,i),l='"+commonL10n.confirmAction+"
"+commonL10n.cantUndo+"
"),btnOKLabel:commonL10n.delete,callback:function(b){if(b){var d=Charcoal.Admin.admin_url()+"object/delete",e={obj_type:a.obj_type,obj_id:a.obj_id};$.ajax({method:"POST",url:d,data:e,dataType:"json"}).done(function(a){a.success?window.location.href=c:window.alert(formWidgetL10n.deleteFailed)})}}})},Charcoal.Admin.Widget_Form.prototype.switch_language=function(a){Charcoal.Admin.lang()!==a&&(Charcoal.Admin.setLang(a),$("[data-lang][data-lang!="+a+"]").addClass("hidden"),$("[data-lang][data-lang="+a+"]").removeClass("hidden"),$("[data-lang-switch][data-lang-switch!="+a+"]").removeClass("btn-info").addClass("btn-default"),$("[data-lang-switch][data-lang-switch="+a+"]").removeClass("btn-default").addClass("btn-info"),$(document).triggerHandler({type:"switch_language.charcoal"}))},Charcoal.Admin.Widget_Map=function(){return this._controller=void 0,this.widget_type="charcoal/admin/widget/map",this},Charcoal.Admin.Widget_Map.prototype=Object.create(Charcoal.Admin.Widget.prototype),Charcoal.Admin.Widget_Map.prototype.constructor=Charcoal.Admin.Widget_Map,Charcoal.Admin.Widget_Map.prototype.parent=Charcoal.Admin.Widget.prototype,Charcoal.Admin.Widget_Map.prototype.init=function(){var a=this;return"undefined"==typeof google?(window._tmp_google_onload_function=function(){a.activate_map()},$.getScript("https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&callback=_tmp_google_onload_function",function(){})):a.activate_map(),this},Charcoal.Admin.Widget_Map.prototype.activate_map=function(){var a={strokeColor:"#000000",strokeOpacity:.8,strokeWeight:3,fillColor:"#ffffff",fillOpacity:.35,hover:{strokeColor:"#000000",strokeOpacity:1,strokeWeight:2,fillColor:"#ffffff",fillOpacity:.5},focused:{fillOpacity:.8}},b={default_styles:a,use_clusterer:!1,map:{center:{x:this.opts("coords")[0],y:this.opts("coords")[1]},zoom:14,mapType:"roadmap",coordsType:"inpage",map_mode:"default"},places:{first:{type:"marker",coords:this.coords()}}};this._controller=new window.BB.gmap.controller(this.element().find(".js-map-maker-map").get(0),b),this.controller().set_styles([{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]}]),this.controller().remove_focus(),this.controller().init()},Charcoal.Admin.Widget_Map.prototype.controller=function(){return this._controller},Charcoal.Admin.Widget_Map.prototype.coords=function(){return this.opts("coords")},Charcoal.Admin.Widget_Quick_Form=function(a){return this.widget_type="charcoal/admin/widget/quick-form",this.save_callback=a.save_callback||"",this.cancel_callback=a.cancel_callback||"",this.save_action=a.save_action||"object/save",this.update_action=a.update_action||"object/update",this.extra_form_data=a.extra_form_data||{},this.form_working=!1,this.suppress_feedback=a.suppress_feedback||!1,this.is_new_object=!1,this.xhr=null,this.obj_id=Charcoal.Admin.parseNumber(a.obj_id)||0,this},Charcoal.Admin.Widget_Quick_Form.prototype=Object.create(Charcoal.Admin.Widget.prototype),Charcoal.Admin.Widget_Quick_Form.prototype.constructor=Charcoal.Admin.Widget_Quick_Form,Charcoal.Admin.Widget_Quick_Form.prototype.parent=Charcoal.Admin.Widget.prototype,Charcoal.Admin.Widget_Quick_Form.prototype.init=function(){this.bind_events()},Charcoal.Admin.Widget_Quick_Form.prototype.bind_events=function(){var a=this;$(document).on("submit","#"+this.id(),function(b){b.preventDefault(),a.submit_form(this)}),$("#"+this.id()).on("click.charcoal.bs.dialog",'[data-dismiss="dialog"]',function(b){$.isFunction(a.cancel_callback)&&a.cancel_callback(b)})},Charcoal.Admin.Widget_Quick_Form.prototype.submit_form=function(a){if(!this.form_working){this.form_working=!0,this.is_new_object=!this.obj_id;var b,c,d;if(c=$(a),b=c.find('[type="submit"]'),b.prop("disabled"))return!1;Charcoal.Admin.manager().prepare_submit(),d=new FormData(a),this.disable_form(c,b);var e=this.extra_form_data;for(var f in e)e.hasOwnProperty(f)&&d.append(f,e[f]);this.xhr=$.ajax({type:"POST",url:this.request_url(),data:d,dataType:"json",processData:!1,contentType:!1}),this.xhr.then($.proxy(this.request_done,this,c,b)).done($.proxy(this.request_success,this,c,b)).fail($.proxy(this.request_failed,this,c,b)).always($.proxy(this.request_complete,this,c,b))}},Charcoal.Admin.Widget_Quick_Form.prototype.disable_form=Charcoal.Admin.Widget_Form.prototype.disable_form,Charcoal.Admin.Widget_Quick_Form.prototype.enable_form=Charcoal.Admin.Widget_Form.prototype.enable_form,Charcoal.Admin.Widget_Quick_Form.prototype.request_url=Charcoal.Admin.Widget_Form.prototype.request_url,Charcoal.Admin.Widget_Quick_Form.prototype.request_done=Charcoal.Admin.Widget_Form.prototype.request_done,Charcoal.Admin.Widget_Quick_Form.prototype.request_failed=Charcoal.Admin.Widget_Form.prototype.request_failed,Charcoal.Admin.Widget_Quick_Form.prototype.request_complete=Charcoal.Admin.Widget_Form.prototype.request_complete,Charcoal.Admin.Widget_Quick_Form.prototype.request_success=function(a,b,c){c.feedbacks&&!this.suppress_feedback&&Charcoal.Admin.feedback(c.feedbacks),c.next_url&&Charcoal.Admin.feedback().add_action({label:commonL10n.continue,callback:function(){window.location.href=Charcoal.Admin.admin_url()+c.next_url}}),this.enable_form(a,b),this.form_working=!1,"function"==typeof this.save_callback&&this.save_callback(c)},Charcoal.Admin.Widget_Relation=function(){return this.dirty=!1,this},Charcoal.Admin.Widget_Relation.prototype=Object.create(Charcoal.Admin.Widget.prototype), -Charcoal.Admin.Widget_Relation.prototype.constructor=Charcoal.Admin.Widget_Relation,Charcoal.Admin.Widget_Relation.prototype.parent=Charcoal.Admin.Widget.prototype,Charcoal.Admin.Widget_Relation.prototype.init=function(){if("function"!=typeof $.fn.sortable){return Charcoal.Admin.loadScript("https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js",this.init.bind(this)),this}var a=this.element().find(".js-relation-sortable .js-grid-container");return this.element().on("hidden.bs.collapse",'[data-toggle="collapse"]',function(){a.sortable("refreshPositions")}),a.sortable({handle:'[draggable="true"]',placeholder:"panel c-attachment_placeholder",start:function(a,b){b.item.children(".panel-heading").find('[data-toggle="collapse"]').hasClass("collapsed")||b.item.children(".panel-collapse").collapse("hide")}}).disableSelection(),this.listeners(),this},Charcoal.Admin.Widget_Relation.prototype.is_dirty=function(){return this.dirty},Charcoal.Admin.Widget_Relation.prototype.set_dirty_state=function(a){return this.dirty=a,this},Charcoal.Admin.Widget_Relation.prototype.listeners=function(){var a=this;this.element().off("click").on("click.charcoal.relation",".js-add-relation",function(b){b.preventDefault();var c=$(this).data("type");if(!c)return!1;var d=$(this).data("id");if(d)a.add({id:d,type:c}),a.create_relation(function(){a.reload()});else{var e=$(this).data("title")||relationWidgetL10n.editObject;a.create_relation_dialog({title:e,widget_options:{form_data:{target_object_type:c,target_object_id:null}}},function(b){b.success&&(b.obj.id=b.obj_id,a.add(b.obj),a.create_relation(function(){a.reload()}))})}}).on("click.charcoal.relation",".js-relation-actions a",function(b){var c=$(this);if(c.data("action")){b.preventDefault();switch(c.data("action")){case"edit":var d=c.data("type"),e=c.data("id");if(!d||!e)break;var f=c.data("title")||relationWidgetL10n.editObject;a.create_relation_dialog({title:f,widget_options:{form_data:{target_object_type:d,target_object_id:null}}},function(b){b.success&&a.reload()});break;case"unlink":if(!c.data("id"))break;a.confirm({title:relationWidgetL10n.confirmRemoval,message:commonL10n.confirmAction,btnOKLabel:commonL10n.removeObject,callback:function(b){b&&a.remove_relation(c.data("id"),function(){a.reload()})}})}}})},Charcoal.Admin.Widget_Relation.prototype.create_relation_dialog=function(a,b){a=a||{};var c=this.opts().data,d={size:BootstrapDialog.SIZE_WIDE,cssClass:"-quick-form",widget_type:"charcoal/admin/widget/quickForm",widget_options:{obj_type:"charcoal/relation/pivot",obj_id:0,form_data:{group:c.group,source_object_type:c.obj_type,source_object_id:c.obj_id,target_object_type:"",target_object_id:0}}},e={},f=$.extend(!0,{},d,a,e),g=this.dialog(f,function(a){if(a.success){if(!a.widget_id)return!1;Charcoal.Admin.manager().add_widget({id:a.widget_id,type:"charcoal/admin/widget/quick-form",data:{obj_type:f.widget_options.type},obj_id:f.widget_options.id,save_callback:function(a){b(a),g.close()}}),Charcoal.Admin.manager().render()}})},Charcoal.Admin.Widget_Relation.prototype.add=function(a){if(!a)return!1;this.set_dirty_state(!0);var b=this.element().find(".js-relation-template").clone();return b.find(".js-relation").attr({"data-id":a.target_object_id,"data-type":a.target_object_type}),this.element().find(".js-relation-sortable").find(".js-grid-container").append(b),this},Charcoal.Admin.Widget_Relation.prototype.save=function(){if(this.is_dirty())return!1;this.create_relation()},Charcoal.Admin.Widget_Relation.prototype.create_relation=function(a){var b=this,c=b.opts(),d={obj_type:c.data.obj_type,obj_id:c.data.obj_id,group:c.data.group,pivots:[]};this.element().find(".js-relation-container").find(".js-relation").each(function(a){var b=$(this),c=b.attr("data-id"),e=b.attr("data-type");d.pivots.push({target_object_id:c,target_object_type:e,position:a})}),$.post("relation/link",d,function(){"function"==typeof a&&a(),b.set_dirty_state(!1)},"json")},Charcoal.Admin.Widget_Relation.prototype.remove_relation=function(a,b){if(!a)return!1;var c=this,d={pivot_id:a};$.post("relation/unlink",d,function(){"function"==typeof b&&b(),c.set_dirty_state(!1)},"json")},Charcoal.Admin.Widget_Relation.prototype.widget_options=function(){return this.opts("widget_options")},Charcoal.Admin.Widget_Search=function(a){return this._elem=void 0,!!a&&(void 0!==a.id&&(this.set_element($("#"+a.id)),"object"==typeof a.data&&(this.opts=a,this)))},Charcoal.Admin.Widget_Search.prototype=Object.create(Charcoal.Admin.Widget.prototype),Charcoal.Admin.Widget_Search.prototype.constructor=Charcoal.Admin.Widget_Search,Charcoal.Admin.Widget_Search.prototype.parent=Charcoal.Admin.Widget.prototype,Charcoal.Admin.Widget_Search.prototype.set_remote_widget=function(){},Charcoal.Admin.Widget_Search.prototype.init=function(){var a=this.element(),b=this;a.on("click",".js-search",function(a){a.preventDefault(),b.submit()}),a.on("click",".js-undo",function(a){a.preventDefault(),b.undo()})},Charcoal.Admin.Widget_Search.prototype.submit=function(){for(var a=Charcoal.Admin.manager(),b=a.components.widgets,c=0,d=b.length;c"+commonL10n.confirmAction+"
"+commonL10n.cantUndo+"
"),btnOKLabel:commonL10n.delete,callback:function(b){if(b){var c=a.delete_url,d={obj_type:a.obj_type,obj_id:a.obj_id};$.ajax({method:"POST",url:c,data:d,dataType:"json"}).done(function(b){b.success?$(a.element).remove():window.alert(tableWidgetL10n.deleteFailed)})}}})},Charcoal.Admin.Property=function(a){return this._ident=void 0,this._val=void 0,this._type=void 0,this._input_type=void 0,"string"==typeof a.ident&&this.set_ident(a.ident),void 0!==a.val&&this.set_val(a.val),void 0!==a.type&&this.set_type(a.type),void 0!==a.input_type&&this.set_input_type(a.input_type),this.data=a,this},Charcoal.Admin.Property.prototype.set_ident=function(a){this._ident=a},Charcoal.Admin.Property.prototype.set_val=function(a){this._val=a},Charcoal.Admin.Property.prototype.set_type=function(a){this._type=a},Charcoal.Admin.Property.prototype.set_input_type=function(a){this._input_type=a},Charcoal.Admin.Property.prototype.ident=function(){return this._ident},Charcoal.Admin.Property.prototype.val=function(){return this._val},Charcoal.Admin.Property.prototype.type=function(){return this._type},Charcoal.Admin.Property.prototype.input_type=function(){return this._input_type},Charcoal.Admin.Property.prototype.element=function(){if(!this._element){if(!this.data.id)return!1;this._element=$("#"+this.data.id)}return this._element},Charcoal.Admin.Property.prototype.validate=function(){},Charcoal.Admin.Property.prototype.save=function(){return this},Charcoal.Admin.Property.prototype.error=function(a){window.console.error(a)},Charcoal.Admin.Property_Input_Audio=function(a){a.input_type="charcoal/admin/property/input/audio",Charcoal.Admin.Property.call(this,a),this.text_properties={},this.recording_properties={},this.file_properties={},this.initialized_types=[],this.active_pane=a.data.active_pane||"text",this._recorder=void 0,this.init()},Charcoal.Admin.Property_Input_Audio.prototype=Object.create(Charcoal.Admin.Property.prototype),Charcoal.Admin.Property_Input_Audio.prototype.constructor=Charcoal.Admin.Property_Input_Audio,Charcoal.Admin.Property_Input_Audio.prototype.parent=Charcoal.Admin.Property.prototype,Charcoal.Admin.Property_Input_Audio.prototype.init=function(){var a=this.data;void 0===a.id&&console.error("Missing ID"),this.text_properties.$voice_message=$(".js-text-voice-message",this.element()),this.recording_properties.audio_context=null,this.recording_properties.audio_recorder=null,this.recording_properties.animation_frame=null,this.recording_properties.analyser_context=null,this.recording_properties.canvas_width=0,this.recording_properties.canvas_height=0,this.recording_properties.recording_index=0,this.recording_properties.current_recording=null,this.recording_properties.audio_player=null,this.recording_properties.hidden_input_id=a.data.hidden_input_id,this.recording_properties.$analyser_canvas=$(".js-recording-analyser",this.element()),this.recording_properties.$waves_canvas=$(".js-recording-waves",this.element()),this.recording_properties.record_button_class="js-recording-record",this.recording_properties.$record_button=$(".js-recording-record",this.element()),this.recording_properties.stop_button_class="js-recording-stop",this.recording_properties.$stop_button=$(".js-recording-stop",this.element()),this.recording_properties.playback_button_class="js-recording-playback",this.recording_properties.$playback_button=$(".js-recording-playback",this.element()),this.recording_properties.reset_button_class="js-recording-reset",this.recording_properties.$reset_button=$(".js-recording-reset",this.element()),this.recording_properties.$timer=$(".js-recording-timer",this.element()),this.file_properties.$file_audio=$(".js-file-audio",this.element()),this.file_properties.$file_reset=$(".js-file-reset",this.element()),this.file_properties.$file_input=$(".js-file-input",this.element()),this.file_properties.$file_input_hiden=$(".js-file-input-hidden",this.element()),this.file_properties.reset_button_class="js-file-reset",this.set_nav(this.active_pane).bind_nav_controls()},Charcoal.Admin.Property_Input_Audio.prototype.bind_nav_controls=function(){var a=this;this.element().on("click",".js-toggle-pane",function(){var b=$(this);a.set_nav(b.attr("data-pane"))})},Charcoal.Admin.Property_Input_Audio.prototype.set_nav=function(a){if(a){var b=$(".js-toggle-pane"),c=$(".js-pane"),d=c.filter('[data-pane="'+a+'"]');if(!d.hasClass("-active")){var e=b.filter('[data-pane="'+a+'"]');b.removeClass("-active"),e.addClass("-active"),c.removeClass("-active"),c.addClass("hidden"),d.removeClass("hidden"),d.addClass("-active"),this.prepare_pane(a)}}return this},Charcoal.Admin.Property_Input_Audio.prototype.prepare_pane=function(a){var b="init_"+a;"function"==typeof Charcoal.Admin.Property_Input_Audio.prototype[b]&&this[b]()},Charcoal.Admin.Property_Input_Audio.prototype.init_text=function(){if(-1===this.initialized_types.indexOf("text")){this.initialized_types.push("text");var a=this.text_properties.$voice_message.val();a=this.text_strip_tags(a),this.text_properties.$voice_message.val(a)}},Charcoal.Admin.Property_Input_Audio.prototype.text_strip_tags=function(a,b){b=((String(b)||"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var c=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,d=/|<\?(?:php)?[\s\S]*?\?>/gi;return a.replace(d,"").replace(c,function(a,c){return b.indexOf("<"+c.toLowerCase()+">")>-1?a:""})},Charcoal.Admin.Property_Input_Audio.prototype.init_file=function(){-1===this.initialized_types.indexOf("file")&&(this.initialized_types.push("file"),this.file_bind_events())},Charcoal.Admin.Property_Input_Audio.prototype.file_bind_events=function(){var a=this;a.element().on("click","."+a.file_properties.reset_button_class,function(){a.file_reset_input()})},Charcoal.Admin.Property_Input_Audio.prototype.file_reset_input=function(){this.file_properties.$file_audio.attr("src","").addClass("hide"),this.file_properties.$file_reset.addClass("hide"),this.file_properties.$file_input.removeClass("hide").wrap("