Difference between revisions of "AppSuite:Demo"

(Add advertisement banner to mail detail view)
Line 19: Line 19:
 
   }
 
   }
 
});
 
});
 +
</pre>
 +
 +
===Add your own extension===
 +
<pre class="language-javascript">
 +
// calendar detail view
 +
var ext = require("io.ox/core/extensions");
 +
ext.point("io.ox/calendar/detail").extend({
 +
  index: 10,
 +
  id: "dreiChinesen",
 +
  draw: function (appointment) {
 +
    var psuedoChineseTitle = appointment.title.replace(/[aeiou]/g, "o");
 +
    var $titleNode = $("<h2>").text(psuedoChineseTitle);
 +
    return this.append($titleNode);
 +
  }
 +
});
 +
</pre>
 +
 +
===Disable and re-enable===
 +
<pre class="language-javascript">
 +
// Disable participants
 +
var ext = require("io.ox/core/extensions");
 +
ext.point("io.ox/calendar/detail").disable("participants");
 +
 +
// Re-enable participants
 +
var ext = require("io.ox/core/extensions");
 +
ext.point("io.ox/calendar/detail").enable("participants");
 
</pre>
 
</pre>

Revision as of 19:01, 24 April 2013

Demo Stuff

Extension points

Add advertisement banner to mail detail view

 
var ext = require("io.ox/core/extensions");
ext.point('io.ox/mail/detail').extend({
  index: 180,
  id: 'ad',
  draw: function (data) {
    this.append(
      $("<div>")
      .css({
        backgroundImage: "url(http://upload.wikimedia.org/wikipedia/commons/b/b0/Qxz-ad39.png)",
        width: '468px',
        height: "60px",
        margin: "0px auto 20px auto"
      })
    );
  }
});

Add your own extension

 
// calendar detail view
var ext = require("io.ox/core/extensions");
ext.point("io.ox/calendar/detail").extend({
  index: 10,
  id: "dreiChinesen",
  draw: function (appointment) {
    var psuedoChineseTitle = appointment.title.replace(/[aeiou]/g, "o");
    var $titleNode = $("<h2>").text(psuedoChineseTitle);
    return this.append($titleNode);
  }
});

Disable and re-enable

 
// Disable participants
var ext = require("io.ox/core/extensions");
ext.point("io.ox/calendar/detail").disable("participants");

// Re-enable participants
var ext = require("io.ox/core/extensions");
ext.point("io.ox/calendar/detail").enable("participants");