DEV: global s/this.get\("(\w+)"\)/this.$1 (#7592)

DEV: global s/this.get("(\w+)")/this.$1 (#7592)

diff --git a/app/assets/javascripts/admin/components/ace-editor.js.es6 b/app/assets/javascripts/admin/components/ace-editor.js.es6
index b3576c8..2fa0c16 100644
--- a/app/assets/javascripts/admin/components/ace-editor.js.es6
+++ b/app/assets/javascripts/admin/components/ace-editor.js.es6
@@ -10,7 +10,7 @@ export default Ember.Component.extend({
 
   @observes("editorId")
   editorIdChanged() {
-    if (this.get("autofocus")) {
+    if (this.autofocus) {
       this.send("focus");
     }
   },
@@ -18,14 +18,14 @@ export default Ember.Component.extend({
   @observes("content")
   contentChanged() {
     if (this._editor && !this._skipContentChangeEvent) {
-      this._editor.getSession().setValue(this.get("content"));
+      this._editor.getSession().setValue(this.content);
     }
   },
 
   @observes("mode")
   modeChanged() {
     if (this._editor && !this._skipContentChangeEvent) {
-      this._editor.getSession().setMode("ace/mode/" + this.get("mode"));
+      this._editor.getSession().setMode("ace/mode/" + this.mode);
     }
   },
 
@@ -37,7 +37,7 @@ export default Ember.Component.extend({
   changeDisabledState() {
     const editor = this._editor;
     if (editor) {
-      const disabled = this.get("disabled");
+      const disabled = this.disabled;
       editor.setOptions({
         readOnly: disabled,
         highlightActiveLine: !disabled,
@@ -79,7 +79,7 @@ export default Ember.Component.extend({
         editor.setTheme("ace/theme/chrome");
         editor.setShowPrintMargin(false);
         editor.setOptions({ fontSize: "14px" });
-        editor.getSession().setMode("ace/mode/" + this.get("mode"));
+        editor.getSession().setMode("ace/mode/" + this.mode);
         editor.on("change", () => {
           this._skipContentChangeEvent = true;
           this.set("content", editor.getSession().getValue());
@@ -103,7 +103,7 @@ export default Ember.Component.extend({
           this.appEvents.on("ace:resize", this, "resize");
         }
 
-        if (this.get("autofocus")) {
+        if (this.autofocus) {
           this.send("focus");
         }
       });
diff --git a/app/assets/javascripts/admin/components/admin-backups-logs.js.es6 b/app/assets/javascripts/admin/components/admin-backups-logs.js.es6
index 4db599b..56f9032 100644
--- a/app/assets/javascripts/admin/components/admin-backups-logs.js.es6
+++ b/app/assets/javascripts/admin/components/admin-backups-logs.js.es6
@@ -25,7 +25,7 @@ export default Ember.Component.extend(
     @on("init")
     @observes("logs.[]")
     _resetFormattedLogs() {
-      if (this.get("logs").length === 0) {
+      if (this.logs.length === 0) {
         this._reset(); // reset the cached logs whenever the model is reset
         this.rerenderBuffer();
       }
@@ -34,12 +34,12 @@ export default Ember.Component.extend(
     @on("init")
     @observes("logs.[]")
     _updateFormattedLogs: debounce(function() {
-      const logs = this.get("logs");
+      const logs = this.logs;
       if (logs.length === 0) return;
 
       // do the log formatting only once for HELLish performance
-      let formattedLogs = this.get("formattedLogs");
-      for (let i = this.get("index"), length = logs.length; i < length; i++) {
+      let formattedLogs = this.formattedLogs;
+      for (let i = this.index, length = logs.length; i < length; i++) {
         const date = logs[i].get("timestamp"),
           message = escapeExpression(logs[i].get("message"));
         formattedLogs += "[" + date + "] " + message + "\n";
@@ -56,7 +56,7 @@ export default Ember.Component.extend(
     }, 150),
 
     buildBuffer(buffer) {
-      const formattedLogs = this.get("formattedLogs");
+      const formattedLogs = this.formattedLogs;
       if (formattedLogs && formattedLogs.length > 0) {
         buffer.push("<pre>");
         buffer.push(formattedLogs);
diff --git a/app/assets/javascripts/admin/components/admin-directory-toggle.js.es6 b/app/assets/javascripts/admin/components/admin-directory-toggle.js.es6
index add82cb..f248080 100644
--- a/app/assets/javascripts/admin/components/admin-directory-toggle.js.es6
+++ b/app/assets/javascripts/admin/components/admin-directory-toggle.js.es6
@@ -8,27 +8,25 @@ export default Ember.Component.extend(
     rerenderTriggers: ["order", "ascending"],
 
     buildBuffer(buffer) {
-      const icon = this.get("icon");
+      const icon = this.icon;
 
       if (icon) {
         buffer.push(iconHTML(icon));
       }
 
-      buffer.push(I18n.t(this.get("i18nKey")));
+      buffer.push(I18n.t(this.i18nKey));
 
-      if (this.get("field") === this.get("order")) {
-        buffer.push(
-          iconHTML(this.get("ascending") ? "chevron-up" : "chevron-down")
-        );
+      if (this.field === this.order) {
+        buffer.push(iconHTML(this.ascending ? "chevron-up" : "chevron-down"));
       }
     },
 
     click() {
-      const currentOrder = this.get("order");
-      const field = this.get("field");
+      const currentOrder = this.order;
+      const field = this.field;
 
       if (currentOrder === field) {
-        this.set("ascending", this.get("ascending") ? null : true);
+        this.set("ascending", this.ascending ? null : true);
       } else {
         this.setProperties({ order: field, ascending: null });
       }
diff --git a/app/assets/javascripts/admin/components/admin-editable-field.js.es6 b/app/assets/javascripts/admin/components/admin-editable-field.js.es6
index 4c23ea6..9d91e2a 100644
--- a/app/assets/javascripts/admin/components/admin-editable-field.js.es6
+++ b/app/assets/javascripts/admin/components/admin-editable-field.js.es6
@@ -11,13 +11,13 @@ export default Ember.Component.extend({
 
   actions: {
     edit() {
-      this.set("buffer", this.get("value"));
+      this.set("buffer", this.value);
       this.toggleProperty("editing");
     },
 
     save() {
       // Action has to toggle 'editing' property.
-      this.action(this.get("buffer"));
+      this.action(this.buffer);
     }
   }
 });
diff --git a/app/assets/javascripts/admin/components/admin-graph.js.es6 b/app/assets/javascripts/admin/components/admin-graph.js.es6
index 9f6d83b..0c356c1 100644
--- a/app/assets/javascripts/admin/components/admin-graph.js.es6
+++ b/app/assets/javascripts/admin/components/admin-graph.js.es6
@@ -6,7 +6,7 @@ export default Ember.Component.extend({
 
   refreshChart() {
     const ctx = this.$()[0].getContext("2d");
-    const model = this.get("model");
+    const model = this.model;
     const rawData = this.get("model.data");
 
     var data = {
@@ -16,7 +16,7 @@ export default Ember.Component.extend({
           data: rawData.map(r => r.y),
           label: model.get("title"),
           backgroundColor: `rgba(200,220,240,${
-            this.get("type") === "bar" ? 1 : 0.3
+            this.type === "bar" ? 1 : 0.3
           })`,
           borderColor: "#08C"
         }
@@ -24,7 +24,7 @@ export default Ember.Component.extend({
     };
 
     const config = {
-      type: this.get("type"),
+      type: this.type,
       data: data,
       options: {
         responsive: true,
diff --git a/app/assets/javascripts/admin/components/admin-report-chart.js.es6 b/app/assets/javascripts/admin/components/admin-report-chart.js.es6
index 1c97f95..b4ced4e 100644
--- a/app/assets/javascripts/admin/components/admin-report-chart.js.es6
+++ b/app/assets/javascripts/admin/components/admin-report-chart.js.es6
@@ -35,7 +35,7 @@ export default Ember.Component.extend({
 
   _scheduleChartRendering() {
     Ember.run.schedule("afterRender", () => {
-      this._renderChart(this.get("model"), this.$(".chart-canvas"));
+      this._renderChart(this.model, this.$(".chart-canvas"));
     });
   },
 
diff --git a/app/assets/javascripts/admin/components/admin-report-stacked-chart.js.es6 b/app/assets/javascripts/admin/components/admin-report-stacked-chart.js.es6
index 961a1fb..97b26fd 100644
--- a/app/assets/javascripts/admin/components/admin-report-stacked-chart.js.es6
+++ b/app/assets/javascripts/admin/components/admin-report-stacked-chart.js.es6

[... diff too long, it was truncated ...]

GitHub sha: bfea9221

2 Likes