github github
stdbrouw
  • Dashboard
  • Inbox 0
  • Account Settings
  • Log Out
Advanced Search
  • Explore GitHub
  • Gist
  • Blog
  • Help

stdbrouw / Extendables

  • Admin
  • Watch Unwatch
  • Fork
  • Where do you want to fork this to?

    Already forked to stdbrouw! Go to the fork

    You don't have permission to create new repositories for camayak

  • Pull Request
    • 1
    • 1
  • Source
  • Commits
  • Network
  • Pull Requests (0)
  • Fork Queue
  • Issues (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Switch Branches (2)
    • gh-pages
    • master ✓
  • Switch Tags (0)
  • Branch List
Sending Request…
Downloads

A framework for Adobe ExtendScript. — Read more

  Cancel

http://stdbrouw.github.com/Extendables/

  Cancel
  • SSH
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Last go through the docs before releasing 0.3a; slightly improved Asset#place in dom.indesign.jsx 
stdbrouw (author)
Mon Nov 01 03:46:49 -0700 2010
commit  121f20cfeceb5ed84464
tree    3aedfb40f07e432e0f40
parent  7b670b6b29d1a2666e49
Extendables / examples / basic.jsx examples/basic.jsx
Txt 100644 45 lines (40 sloc) 1.379 kb
  • edit
  • raw
  • blame
  • history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "../extendables.jsx";

// namespaces, so there are no variables all over the place
var ui = require("ui");
var http = require("http");

function fetch_recipes (amount) {
if (!http.has_internet_access()) throw new Error("No internet, no recipes.");
// range returns an array containing the asked range of numbers,
// and each number gets mapped to / replaced by a recipe
return Number.range(amount).map(function () {
var response = http.get("http://whatthefuckshouldimakefordinner.com/");
// the first link on the page is a recipe;
// don't do this at home -- parsing html with
// regular expressions is evil
return response.body.match(/<a.+>(.+)<\/a>/)[1];
});
}

// the UI library allows us to separate style from structure,
// leading to cleaner code
var styling = {
'big': {
'size': [400, 15],
'justify': 'center'
}
}
var dialog = new ui.Dialog("I'm hungry").with(styling);
var suggestion = dialog.row('suggestion');
dialog.text('food', 'Want some food suggestions?').using('big')
.button('ok', 'Sure thing!')
.button('no', 'No thanks');

// event handlers, the easy way
dialog.ok.on('click').do(function(){
dialog.food.text = "Wait a sec, coming up!";
dialog.food.text = fetch_recipes(1).first();
dialog.ok.text = "Hmm...";
});
dialog.no.on('click').do(function(){
this.window.close();
});

// let's get started
dialog.window.show();
Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • Русский
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Русский
  • Српски
  • Svenska
  • 中文

Keyboard Shortcuts

Site wide shortcuts

s
Focus site search
?
Bring up this help dialog

Commit list

j
Move selected down
k
Move selected up
t
Open tree
p
Open parent
c or o or enter
Open commit

Pull request list

j
Move selected down
k
Move selected up
o or enter
Open issue

Issues

j
Move selected down
k
Move selected up
x
Toggle select target
o or enter
Open issue
I
Mark selected as read
U
Mark selected as unread
e
Close selected
y
Remove selected from view
c
Create issue
l
Create label
i
Back to inbox
u
Back to issues
/
Focus issues search

Network Graph

← or h
Scroll left
→ or l
Scroll right
↑ or k
Scroll up
↓ or j
Scroll down
t
Toggle visibility of head labels
shift ← or shift h
Scroll all the way left
shift → or shift l
Scroll all the way right
shift ↑ or shift k
Scroll all the way up
shift ↓ or shift j
Scroll all the way down