PATH:
home
/
lab2454c
/
mact34.com
/
wp-content
/
plugins
/
tryo-toolkit
/
redux
/
ReduxCore
/
inc
/
fields
/
typography
!function(j){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.typography=redux.field_objects.typography||{};var C=[],z=!1,k={width:"resolve",triggerChange:!0,allowClear:!0};redux.field_objects.typography.init=function(e,t){e||(e=j(document).find(".redux-group-tab:visible").find(".redux-container-typography:visible")),j(e).each(function(){var r,e=j(this),t=e;(e.hasClass("redux-field-container")||(t=e.parents(".redux-field-container:first")),t.is(":hidden"))||t.hasClass("redux-field-init")&&(t.removeClass("redux-field-init"),e.each(function(){j(this).find(".redux-typography-container").each(function(){var e=j(this).find(".redux-typography-family");void 0===e.data("value")?e=j(this):""!==e.data("value")&&j(e).val(e.data("value"));var t=j(this).find(".select2_params");if(0<t.size()){var a=t.val();a=JSON.parse(a),k=j.extend({},k,a)}r=Boolean(j(this).find(".redux-font-clear").val()),redux.field_objects.typography.select(e,!0),window.onbeforeunload=null}),j(this).find(".redux-typography").on("change",function(){redux.field_objects.typography.select(j(this))}),j(this).find(".redux-typography-size, .redux-typography-height, .redux-typography-word, .redux-typography-letter, .redux-typography-align, .redux-typography-transform, .redux-typography-font-variant, .redux-typography-decoration").keyup(function(){redux.field_objects.typography.select(j(this).parents(".redux-container-typography:first"))}),j(this).find(".redux-typography-color").wpColorPicker({change:function(e,t){j(this).val(t.color.toString()),redux.field_objects.typography.select(j(this))}}),j(this).find(".redux-typography-size").numeric({allowMinus:!1}),j(this).find(".redux-typography-height, .redux-typography-word, .redux-typography-letter").numeric({allowMinus:!0});var d=[{id:"none",text:"none"}];j(this).find(".redux-typography-family").select2({matcher:function(e,t){return 0===t.toUpperCase().indexOf(e.toUpperCase())},query:function(e){return window.Select2.query.local(d)(e)},initSelection:function(e,t){t({id:e.val(),text:e.val()})},allowClear:r}).on("select2-opening",function(e){var t=j(this).parents(".redux-container-typography:first").attr("data-id"),a=j("#"+t+" .redux-typography-font-family").data("user-fonts");a=a?1:0;var r=j("#"+t+" .redux-typography-google").val();r=r?1:0;var o=[];if(void 0!==redux.customfonts&&o.push(redux.customfonts),void 0!==redux.stdfonts&&0===a&&o.push(redux.stdfonts),1==a){var p=[];for(var s in redux.typography[t]){var y=redux.typography[t].std_font;for(var i in y)y.hasOwnProperty(i)&&p.push({id:i,text:i,"data-google":"false"})}var l={text:"Standard Fonts",children:p};o.push(l)}(1==r||!0===r&&void 0!==redux.googlefonts)&&o.push(redux.googlefonts),d=o;var n=j("#"+t+" #"+t+"-family").attr("placeholder");n||(n=null),j("#"+t+" .redux-typography-family").select2("val",n)}).on("select2-selecting",function(e,t){var a=e.object.text,r=j(this).parents(".redux-container-typography:first").attr("data-id");j("#"+r+" #"+r+"-family").data("value",a),j("#"+r+" #"+r+"-family").attr("placeholder",a),C=e,z=!0,redux.field_objects.typography.select(j(this).parents(".redux-container-typography:first"))}).on("select2-clearing",function(e,t){var a=j(this).parents(".redux-container-typography:first").attr("data-id");j("#"+a+" #"+a+"-family").attr("data-value",""),j("#"+a+" #"+a+"-family").attr("placeholder","Font Family"),j("#"+a+" #"+a+"-google-font").val("false"),redux.field_objects.typography.select(j(this).parents(".redux-container-typography:first"))}),e.find(".redux-typography-family").hasClass("redux-typography-family")||e.find(".redux-typography-style").select2(k),e.find(".redux-typography-family-backup, .redux-typography-align, .redux-typography-transform, .redux-typography-font-variant, .redux-typography-decoration").select2(k)}))})},redux.field_objects.typography.size=function(e){var t,a=0;for(t in e)e.hasOwnProperty(t)&&a++;return a},redux.field_objects.typography.makeBool=function(e){return"false"!=e&&"0"!=e&&!1!==e&&0!==e&&("true"==e||"1"==e||!0===e||1==e||void 0)},redux.field_objects.typography.contrastColour=function(e){var t="#444444";""!==e&&(e=e.replace("#",""),t=128<=(299*parseInt(e.substr(0,2),16)+587*parseInt(e.substr(2,2),16)+114*parseInt(e.substr(4,2),16))/1e3?"#444444":"#ffffff");return t},redux.field_objects.typography.select=function(e,t){var a;void 0===(a=j(e).parents(".redux-container-typography:first").attr("data-id"))&&(a=j(e).attr("data-id"));j(e).parents(".redux-container-typography:first");var r=j("#"+a+" #"+a+"-family").val();r||(r=null);var o,p=j("#"+a+" select.redux-typography-family-backup").val(),s=j("#"+a+" .redux-typography-size").val(),y=j("#"+a+" .redux-typography-height").val(),i=j("#"+a+" .redux-typography-word").val(),l=j("#"+a+" .redux-typography-letter").val(),n=j("#"+a+" select.redux-typography-align").val(),d=j("#"+a+" select.redux-typography-transform").val(),h=j("#"+a+" select.redux-typography-font-variant").val(),u=j("#"+a+" select.redux-typography-decoration").val(),g=j("#"+a+" select.redux-typography-style").val(),c=j("#"+a+" select.redux-typography-subsets").val(),f=j("#"+a+" .redux-typography-color").val(),x=j("#"+a).data("units");!0===z?(o=redux.field_objects.typography.makeBool(C.object["data-google"]),j("#"+a+" .redux-typography-google-font").val(o)):o=redux.field_objects.typography.makeBool(j("#"+a+" .redux-typography-google-font").val()),j("#"+a).hasClass("typography-initialized")||(g=j("#"+a+" select.redux-typography-style").data("value"),c=j("#"+a+" select.redux-typography-subsets").data("value"),""!==g&&(g=String(g)),void 0!==typeof c&&(c=String(c))),void 0===redux.fonts.google&&(o=!1);var v="";if(v=!0===o&&r in redux.fonts.google?redux.fonts.google[r]:{400:"Normal 400",700:"Bold 700","400italic":"Normal 400 Italic","700italic":"Bold 700 Italic"},j(e).hasClass("redux-typography-subsets")&&j("#"+a+" input.typography-subsets").val(c),j(e).hasClass("redux-typography-family")){var b='<option value=""></option>';if(!0===o){var m="";j.each(v.variants,function(e,t){t.id===g||1===redux.field_objects.typography.size(v.variants)?(m=' selected="selected"',g=t.id):m="",b+='<option value="'+t.id+'"'+m+">"+t.name.replace(/\+/g," ")+"</option>"}),j("#"+a+" .redux-typography-style").select2("destroy"),j("#"+a+" .redux-typography-style").html(b),j("#"+a+" .redux-typography-style").select2(k),m="",b='<option value=""></option>',j.each(v.subsets,function(e,t){t.id===c||1===redux.field_objects.typography.size(v.subsets)?(m=' selected="selected"',c=t.id,j("#"+a+" input.typography-subsets").val(c)):m="",b+='<option value="'+t.id+'"'+m+">"+t.name.replace(/\+/g," ")+"</option>"}),j("#"+a+" .redux-typography-subsets").select2("destroy"),j("#"+a+" .redux-typography-subsets").html(b),j("#"+a+" .redux-typography-subsets").select2(k),j("#"+a+" .redux-typography-subsets").parent().fadeIn("fast"),j("#"+a+" .typography-family-backup").fadeIn("fast")}else v&&(j.each(v,function(e,t){e===g||"normal"===e?(m=' selected="selected"',j("#"+a+" .typography-style .select2-chosen").text(t)):m="",b+='<option value="'+e+'"'+m+">"+t.replace("+"," ")+"</option>"}),j("#"+a+" .redux-typography-style").select2("destroy"),j("#"+a+" .redux-typography-style").html(b),j("#"+a+" .redux-typography-style").select2(k),j("#"+a+" .redux-typography-subsets").parent().fadeOut("fast"),j("#"+a+" .typography-family-backup").fadeOut("fast"));j("#"+a+" .redux-typography-font-family").val(r)}else j(e).hasClass("redux-typography-family-backup")&&""!==p&&j("#"+a+" .redux-typography-font-family-backup").val(p);if(0===j("#"+a+" select.redux-typography-style option[value='"+g+"']").length?(g="",j("#"+a+" select.redux-typography-style").select2("val","")):"400"===g&&j("#"+a+" select.redux-typography-style").select2("val",g),0===j("#"+a+" select.redux-typography-subsets option[value='"+c+"']").length&&(c="",j("#"+a+" select.redux-typography-subsets").select2("val",""),j("#"+a+" input.typography-subsets").val(c)),j("."+("style_link_"+a)).remove(),null!==r&&"inherit"!==r&&j("#"+a).hasClass("typography-initialized")){var w=r.replace(/\s+/g,"+");if(!0===o){var _=w;g&&""!==g&&(_+=":"+g.replace(/\-/g," ")),c&&""!==c&&(_+="&subset="+c),!1===z&&"undefined"!=typeof WebFont&&WebFont&&WebFont.load({google:{families:[_]}}),j("#"+a+" .redux-typography-google").val(!0)}else j("#"+a+" .redux-typography-google").val(!1)}(-1!==g.indexOf("italic")?(j("#"+a+" .typography-preview").css("font-style","italic"),j("#"+a+" .typography-font-style").val("italic"),g=g.replace("italic","")):(j("#"+a+" .typography-preview").css("font-style","normal"),j("#"+a+" .typography-font-style").val("")),j("#"+a+" .typography-font-weight").val(g),y||(y=s),""===s||void 0===s?j("#"+a+" .typography-font-size").val(""):j("#"+a+" .typography-font-size").val(s+x),""===y||void 0===y?j("#"+a+" .typography-line-height").val(""):j("#"+a+" .typography-line-height").val(y+x),""===i||void 0===i?j("#"+a+" .typography-word-spacing").val(""):j("#"+a+" .typography-word-spacing").val(i+x),""===l||void 0===l?j("#"+a+" .typography-letter-spacing").val(""):j("#"+a+" .typography-letter-spacing").val(l+x),j("#"+a).hasClass("typography-initialized"))&&("0"==j("#"+a+" .typography-preview").data("preview-size")&&j("#"+a+" .typography-preview").css("font-size",s+x),j("#"+a+" .typography-preview").css("font-weight",g),j("#"+a+" .typography-preview").css("font-family",r+", sans-serif"),"none"===r&&""===r&&j("#"+a+" .typography-preview").css("font-family","inherit"),j("#"+a+" .typography-preview").css("line-height",y+x),j("#"+a+" .typography-preview").css("word-spacing",i+x),j("#"+a+" .typography-preview").css("letter-spacing",l+x),f&&(j("#"+a+" .typography-preview").css("color",f),j("#"+a+" .typography-preview").css("background-color",redux.field_objects.typography.contrastColour(f))),j("#"+a+" .typography-style .select2-chosen").text(j("#"+a+" .redux-typography-style option:selected").text()),j("#"+a+" .typography-script .select2-chosen").text(j("#"+a+" .redux-typography-subsets option:selected").text()),n&&j("#"+a+" .typography-preview").css("text-align",n),d&&j("#"+a+" .typography-preview").css("text-transform",d),h&&j("#"+a+" .typography-preview").css("font-variant",h),u&&j("#"+a+" .typography-preview").css("text-decoration",u),j("#"+a+" .typography-preview").slideDown());j("#"+a).hasClass("typography-initialized")||j("#"+a).addClass("typography-initialized"),z=!1,t||redux_change(e)}}(jQuery);
[-] field_typography.js
[edit]
[-] field_typography.css.map
[edit]
[-] field_typography.scss
[edit]
[-] field_typography_json.js
[edit]
[+]
..
[-] field_typography_json.min.js
[edit]
[-] field_typography.min.js
[edit]
[-] field_typography.php
[edit]
[-] googlefonts.php
[edit]
[-] field_typography.css
[edit]
[-] field_typography.json
[edit]