Skip to content

Localize from object #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Removed function properties in sample object
Since we want the examples to be fully functional and show how the library
is meant to be used, I've removed the properties for which I've assigned a
function as their value.

Still, the sanitizer callback will be kept and so will the test to
guarantee that there will be no problem if the user passes an object that
include a function among their keys.
  • Loading branch information
LonelyPrincess committed Jul 9, 2017
commit b7dff520a9213e70d84da9f7e080fcb3027a9033
8 changes: 1 addition & 7 deletions examples/objectDS/localize_from_object.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ <h1>Test localization...</h1>
<p data-localize="basic">It failed :(</p>
<p data-localize="message">Optional callback never happened.</p>

<p data-localize="function">This text should remain unchanged</p>
<input data-localize="function" type="text" value="fixed value" readonly />
<input data-localize="added_function" type="text" value="fixed value" readonly />

<script type="text/javascript" charset="utf-8">
$(function(){
var object = {
Expand All @@ -56,13 +52,11 @@ <h1>Test localization...</h1>
"with_title": {
"text": "with_title text success",
"title": "with_title title success"
},
"function": function () {}
}
};

var customCallback = function(data, defaultCallback) {
data.message = "Optional call back works.";
data.added_function = function () {};
defaultCallback(data);
};

Expand Down