This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function htmlEncode(value){ | |
return $('<div/>').text(value).html(); | |
} | |
function htmlDecode(value){ | |
return $('<div/>').html(value).text(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.serializeObject = function() { | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var formRecord = {},prefix = "javascript:(function(){",postfix = "})();",setFormRecord=function(){var elValue = "";var tag = $(this).prop("tagName");if ( "SELECT" === tag || "INPUT" === tag){formRecord[$(this).attr("id")] = $(this).val();}else if ( "FIELDSET" === tag){$(this).find("input[type=radio]").each(function(){formRecord[$(this).attr("id")] = $(this).is(":checked");});}else if("BUTTON" === tag){formRecord[$(this).attr("id")] = "";}},generateScriptLet = function(){var strFormRecord = JSON.stringify(formRecord);var scriptLet = "var fD = " + strFormRecord + "; ";scriptLet += "$(document).ajaxSuccess(function(event,xhr,settings){var $markup=$(xhr.responseText);$markup.find('select').each(function(){var elId=$(this).attr('id');if(fD[elId]){var $that=$(this);setTimeout(function(){$('#' + elId).val(fD[elId]);}, 1000);}});});for(var k in fD){var selector ='#'+k;var $el=$(selector);if($el.prop('type') === 'radio'){$el.prop('checked',fD[k]).trigger('change');}else if($el.prop('type') === ' |