PATH:
home
/
lab2454c
/
mact34.com
/
wp-content
/
plugins
/
tryo-toolkit
/
redux
/
ReduxCore
/
inc
/
fields
/
typography
!function(_){"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};_(document).ready(function(){}),redux.field_objects.typography.init=function(e,t){e||(e=_(document).find(".redux-group-tab:visible").find(".redux-container-typography:visible")),_(e).each(function(){var r,e=_(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(){_(this).find(".redux-typography-container").each(function(){var e=_(this).find(".redux-typography-family");void 0===e.data("value")?e=_(this):""!==e.data("value")&&_(e).val(e.data("value"));var t=_(this).find(".select2_params");if(0<t.size()){var a=t.val();a=JSON.parse(a),k=_.extend({},k,a)}r=Boolean(_(this).find(".redux-font-clear").val()),redux.field_objects.typography.select(e,!0),window.onbeforeunload=null}),_(this).find(".redux-typography").on("change",function(){redux.field_objects.typography.select(_(this))}),_(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(_(this).parents(".redux-container-typography:first"))}),_(this).find(".redux-typography-color").wpColorPicker({change:function(e,t){_(this).val(t.color.toString()),redux.field_objects.typography.select(_(this).parents(".redux-container-typography:first"))}}),_(this).find(".redux-typography-size").numeric({allowMinus:!1}),_(this).find(".redux-typography-height, .redux-typography-word, .redux-typography-letter").numeric({allowMinus:!0});var d=[{id:"none",text:"none"}];_(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=_(this).parents(".redux-container-typography:first").attr("data-id"),a=_("#"+t+" .redux-typography-font-family").data("user-fonts");a=a?1:0;var r=_("#"+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 y in redux.typography[t]){var s=redux.typography[t].std_font;for(var i in s)s.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=_("#"+t+" #"+t+"-family").attr("placeholder");n||(n=null),_("#"+t+" .redux-typography-family").select2("val",n)}).on("select2-selecting",function(e,t){var a=e.object.text,r=_(this).parents(".redux-container-typography:first").attr("data-id");_("#"+r+" #"+r+"-family").data("value",a),_("#"+r+" #"+r+"-family").attr("placeholder",a),C=e,z=!0,redux.field_objects.typography.select(_(this).parents(".redux-container-typography:first"))}).on("select2-clearing",function(e,t){var a=_(this).parents(".redux-container-typography:first").attr("data-id");_("#"+a+" #"+a+"-family").attr("data-value",""),_("#"+a+" #"+a+"-family").attr("placeholder","Font Family"),_("#"+a+" #"+a+"-google-font").val("false"),redux.field_objects.typography.select(_(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.change=function(e){var t={};jQuery(e).find(".redux-typography-input").each(function(){void 0!==jQuery(this).data("name")&&(t[jQuery(this).data("name")]=jQuery(this).val())}),jQuery(e).find(".typography-data-input:first-child").val(JSON.stringify(t))},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=_(e).parents(".redux-container-typography:first").attr("data-id"))&&(a=_(e).attr("data-id"));_(e).parents(".redux-container-typography:first");var r=_("#"+a+" #"+a+"-family").val();r||(r=null);var o,p=_("#"+a+" select.redux-typography-family-backup").val(),y=_("#"+a+" .redux-typography-size").val(),s=_("#"+a+" .redux-typography-height").val(),i=_("#"+a+" .redux-typography-word").val(),l=_("#"+a+" .redux-typography-letter").val(),n=_("#"+a+" select.redux-typography-align").val(),d=_("#"+a+" select.redux-typography-transform").val(),u=_("#"+a+" select.redux-typography-font-variant").val(),h=_("#"+a+" select.redux-typography-decoration").val(),g=_("#"+a+" select.redux-typography-style").val(),c=_("#"+a+" select.redux-typography-subsets").val(),f=_("#"+a+" .redux-typography-color").val(),x=_("#"+a).data("units");!0===z?(o=redux.field_objects.typography.makeBool(C.object["data-google"]),_("#"+a+" .redux-typography-google-font").val(o)):o=redux.field_objects.typography.makeBool(_("#"+a+" .redux-typography-google-font").val()),_("#"+a).hasClass("typography-initialized")||(g=_("#"+a+" select.redux-typography-style").data("value"),c=_("#"+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"},_(e).hasClass("redux-typography-subsets")&&_("#"+a+" input.typography-subsets").val(c),_(e).hasClass("redux-typography-family")){var b='<option value=""></option>';if(!0===o){var m="";_.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>"}),_("#"+a+" .redux-typography-style").select2("destroy"),_("#"+a+" .redux-typography-style").html(b),_("#"+a+" .redux-typography-style").select2(k),m="",b='<option value=""></option>',_.each(v.subsets,function(e,t){t.id===c||1===redux.field_objects.typography.size(v.subsets)?(m=' selected="selected"',c=t.id,_("#"+a+" input.typography-subsets").val(c)):m="",b+='<option value="'+t.id+'"'+m+">"+t.name.replace(/\+/g," ")+"</option>"}),_("#"+a+" .redux-typography-subsets").select2("destroy"),_("#"+a+" .redux-typography-subsets").html(b),_("#"+a+" .redux-typography-subsets").select2(k),_("#"+a+" .redux-typography-subsets").parent().fadeIn("fast"),_("#"+a+" .typography-family-backup").fadeIn("fast")}else v&&(_.each(v,function(e,t){e===g||"normal"===e?(m=' selected="selected"',_("#"+a+" .typography-style .select2-chosen").text(t)):m="",b+='<option value="'+e+'"'+m+">"+t.replace("+"," ")+"</option>"}),_("#"+a+" .redux-typography-style").select2("destroy"),_("#"+a+" .redux-typography-style").html(b),_("#"+a+" .redux-typography-style").select2(k),_("#"+a+" .redux-typography-subsets").parent().fadeOut("fast"),_("#"+a+" .typography-family-backup").fadeOut("fast"));_("#"+a+" .redux-typography-font-family").val(r)}else _(e).hasClass("redux-typography-family-backup")&&""!==p&&_("#"+a+" .redux-typography-font-family-backup").val(p);if(0===_("#"+a+" select.redux-typography-style option[value='"+g+"']").length?(g="",_("#"+a+" select.redux-typography-style").select2("val","")):"400"===g&&_("#"+a+" select.redux-typography-style").select2("val",g),0===_("#"+a+" select.redux-typography-subsets option[value='"+c+"']").length&&(c="",_("#"+a+" select.redux-typography-subsets").select2("val",""),_("#"+a+" input.typography-subsets").val(c)),_("."+("style_link_"+a)).remove(),null!==r&&"inherit"!==r&&_("#"+a).hasClass("typography-initialized")){var w=r.replace(/\s+/g,"+");if(!0===o){var j=w;g&&""!==g&&(j+=":"+g.replace(/\-/g," ")),c&&""!==c&&(j+="&subset="+c),!1===z&&"undefined"!=typeof WebFont&&WebFont&&WebFont.load({google:{families:[j]}}),_("#"+a+" .redux-typography-google").val(!0)}else _("#"+a+" .redux-typography-google").val(!1)}(-1!==g.indexOf("italic")?(_("#"+a+" .typography-preview").css("font-style","italic"),_("#"+a+" .typography-font-style").val("italic"),g=g.replace("italic","")):(_("#"+a+" .typography-preview").css("font-style","normal"),_("#"+a+" .typography-font-style").val("")),_("#"+a+" .typography-font-weight").val(g),s||(s=y),""===y||void 0===y?_("#"+a+" .typography-font-size").val(""):_("#"+a+" .typography-font-size").val(y+x),""===s||void 0===s?_("#"+a+" .typography-line-height").val(""):_("#"+a+" .typography-line-height").val(s+x),""===i||void 0===i?_("#"+a+" .typography-word-spacing").val(""):_("#"+a+" .typography-word-spacing").val(i+x),""===l||void 0===l?_("#"+a+" .typography-letter-spacing").val(""):_("#"+a+" .typography-letter-spacing").val(l+x),_("#"+a).hasClass("typography-initialized"))&&("0"==_("#"+a+" .typography-preview").data("preview-size")&&_("#"+a+" .typography-preview").css("font-size",y+x),_("#"+a+" .typography-preview").css("font-weight",g),_("#"+a+" .typography-preview").css("font-family",r+", sans-serif"),"none"===r&&""===r&&_("#"+a+" .typography-preview").css("font-family","inherit"),_("#"+a+" .typography-preview").css("line-height",s+x),_("#"+a+" .typography-preview").css("word-spacing",i+x),_("#"+a+" .typography-preview").css("letter-spacing",l+x),f&&(_("#"+a+" .typography-preview").css("color",f),_("#"+a+" .typography-preview").css("background-color",redux.field_objects.typography.contrastColour(f))),_("#"+a+" .typography-style .select2-chosen").text(_("#"+a+" .redux-typography-style option:selected").text()),_("#"+a+" .typography-script .select2-chosen").text(_("#"+a+" .redux-typography-subsets option:selected").text()),n&&_("#"+a+" .typography-preview").css("text-align",n),d&&_("#"+a+" .typography-preview").css("text-transform",d),u&&_("#"+a+" .typography-preview").css("font-variant",u),h&&_("#"+a+" .typography-preview").css("text-decoration",h),_("#"+a+" .typography-preview").slideDown());_("#"+a).hasClass("typography-initialized")||_("#"+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]