Last active
March 28, 2019 02:53
-
-
Save magistrula/5e6cf89c7808df46743793c52206aeb6 to your computer and use it in GitHub Desktop.
Eng Example
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
import Ember from 'ember'; | |
const { $ } = Ember; | |
export default Ember.Controller.extend({ | |
valueToEncode: null, | |
encodedValue: '- - - - - ', | |
valueToDecode: null, | |
decodedValue: '- - - - -', | |
actions: { | |
encode() { | |
const word = this.get('valueToEncode'); | |
const t = word.replace(/\w/g, function(c) { | |
const i = 'abcdefghijklmnopqrstuvwxyz'.indexOf(c); | |
return 'abcdefghijklmnopqrstuvwxyz'[(i + 4) % 26]; | |
}); | |
this.set('encodedValue', t); | |
}, | |
decode() { | |
const word = this.get('valueToDecode'); | |
const t = word.replace(/\w/g, function(c) { | |
const i = 'abcdefghijklmnopqrstuvwxyz'.indexOf(c); | |
return 'abcdefghijklmnopqrstuvwxyz'[(i % 26) - 4]; | |
}); | |
this.set('decodedValue', t); | |
} | |
} | |
}); |
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
body { | |
text-align: center; | |
} | |
div { | |
font-size: 60px; | |
} | |
button { | |
font-size: 24px; | |
} |
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
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment