Skip to content

Instantly share code, notes, and snippets.

@YungSang
Last active January 3, 2016 12:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save YungSang/8466518 to your computer and use it in GitHub Desktop.
Save YungSang/8466518 to your computer and use it in GitHub Desktop.
iChrome Widget の雛形
<template id="template.widgets.hello">
{{#title}}<h2 class="header">{{title}}</h2>{{/title}}
</template>
<template id="template.widgets.hello.desc">
Hello World
</template>
23: {
id: 23,
size: 1,
order: 0,
name: "Hello World",
nicename: "hello",
sizes: ["small"],
desc: "It's a small Hello World.",
settings: [
{
type: "text",
nicename: "title",
label: "Widget Title",
placeholder: "Enter a widget title or leave blank to hide"
}
],
config: {
title: "Hello World",
size: "small"
},
render: function() {
var data = $.extend({}, this.data || {});
if (this.config.title && this.config.title !== "") {
data.title = this.config.title;
}
this.utils.render(data);
}
},
@AMKohn
Copy link

AMKohn commented Jan 17, 2014

Hi,

I just saw your gist, it's almost exactly what I used as a boilerplate for widgets!

Is there a specific one your trying to create?

Avi

@YungSang
Copy link
Author

I just created a primitive one, but have no idea to create a specific one yet. ;)

@AMKohn
Copy link

AMKohn commented Jan 21, 2014

OK, just wondering.

@YungSang
Copy link
Author

@AMKohn
Thank you for comments and also uploading your iChrome project on GitHub.

I compared the source code with the released one in my extensions folder.
I found that it's slightly different; CR/LF <-> NL, icon/*.png and some removed files.

I'd just like to let you know that.
Thanks. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment