This file contains hidden or 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
var app = app || {}; | |
app.views = app.views || {}; | |
app.views.MyView = Backbone.View.extend({ | |
render: function() { | |
// Use a handlebars template or similar here | |
var html = "Some html template content here"; | |
this.$el.html(html); | |
} |
This file contains hidden or 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
var app = app || {}; | |
app.events = _.extend({}, Backbone.Events); | |
new Backbone.View({ | |
events: app.events | |
}); | |
// Trigger events | |
app.events.trigger("some-module:some-event", some, params) |
This file contains hidden or 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
<?php | |
private function dm_view($view, $path, $data = array()) { | |
$CI =& get_instance(); | |
$tp = $CI->load->_ci_view_path; | |
$CI->load->_ci_view_path = $path; | |
$out = $CI->load->view($view, $data, true); |
This file contains hidden or 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
render: function() { | |
var html, $html; | |
html = new EJS({ | |
url: app.config.locations.templates + 'dialogs/font-selection.ejs?' + cacheBeater | |
}).render(); | |
$html = $(html); | |
// Render and instantiate the sub views within html |
This file contains hidden or 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
var project = new Project({ template: "blank" }); | |
for (var i = 0; i < 2; i++) { | |
project.append({ "paragraph": { | |
content: "Some random text" | |
} }); | |
} | |
var body = project.getStyleDeclaration("body"); |
This file contains hidden or 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 getAverageColour() { | |
var colour; | |
var r = 0; | |
var g = 0; | |
var b = 0; | |
var lis = $('.pen li'); | |
for (var index = 0, len = lis.length; index < len; index++) { | |
var li = $(lis[index]); |
This file contains hidden or 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
// | |
// Parent view | |
// | |
new SomeView({ | |
sandbox: sandbox | |
}); | |
// |
This file contains hidden or 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
var doc = { | |
selectText: function(jqSelector) { | |
var text = jqSelector.get(0); | |
if ($.browser.msie) { | |
var range = document.body.createTextRange(); | |
range.moveToElementText(text); | |
range.select(); | |
} else if ($.browser.mozilla || $.browser.opera) { | |
var selection = window.getSelection(); |
This file contains hidden or 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
require.config({ | |
baseUrl: "/js" | |
, paths: { | |
"jquery": "libs/jquery/jquery.min" | |
, "underscore": "libs/underscore/underscore-min" | |
, "backbone": "libs/backbone/backbone-min" | |
, "handlebars": "libs/handlebars/handlebars" | |
, "text": "libs/require/text" | |
} | |
, shim: { |
This file contains hidden or 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
.grid{ | |
width: 100%; | |
height: 100%; | |
background-color: #a9a9a9; | |
border-top: dotted 1px #000; | |
background-image: linear-gradient(90deg, transparent 0px, transparent 1.5px, #fff 1px, #fff 2px), | |
linear-gradient(0, transparent 0px, transparent 1px, #fff 1px, #fff 2px); | |
background-image: -webkit-linear-gradient(90deg, transparent 0px, transparent 1.5px, #fff 1px, #fff 2px), | |
-webkit-linear-gradient(0, transparent 0px, transparent 1px, #fff 1px, #fff 2px); | |
background-image: -moz-linear-gradient(90deg, transparent 0px, transparent 1.5px, #fff 1px, #fff 2px), |