Skip to content

Commit 7dd8f3e

Browse files
author
AceMood
committed
dev
1 parent b5511b8 commit 7dd8f3e

7 files changed

+487
-0
lines changed

.gitignore

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
private
2+
3+
### OSX template
4+
.DS_Store
5+
.AppleDouble
6+
.LSOverride
7+
8+
# Icon must end with two \r
9+
Icon
10+
11+
# Thumbnails
12+
._*
13+
14+
# Files that might appear in the root of a volume
15+
.DocumentRevisions-V100
16+
.fseventsd
17+
.Spotlight-V100
18+
.TemporaryItems
19+
.Trashes
20+
.VolumeIcon.icns
21+
22+
# Directories potentially created on remote AFP share
23+
.AppleDB
24+
.AppleDesktop
25+
Network Trash Folder
26+
Temporary Items
27+
.apdisk
28+
### JetBrains template
29+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
30+
31+
*.iml
32+
33+
## Directory-based project format:
34+
.idea/
35+
# if you remove the above rule, at least ignore the following:
36+
37+
# User-specific stuff:
38+
# .idea/workspace.xml
39+
# .idea/tasks.xml
40+
# .idea/dictionaries
41+
42+
# Sensitive or high-churn files:
43+
# .idea/dataSources.ids
44+
# .idea/dataSources.xml
45+
# .idea/sqlDataSources.xml
46+
# .idea/dynamic.xml
47+
# .idea/uiDesigner.xml
48+
49+
# Gradle:
50+
# .idea/gradle.xml
51+
# .idea/libraries
52+
53+
# Mongo Explorer plugin:
54+
# .idea/mongoSettings.xml
55+
56+
## File-based project format:
57+
*.ipr
58+
*.iws
59+
60+
## Plugin-specific files:
61+
62+
# IntelliJ
63+
/out/
64+
65+
# mpeltonen/sbt-idea plugin
66+
.idea_modules/
67+
68+
# JIRA plugin
69+
atlassian-ide-plugin.xml
70+
71+
# Crashlytics plugin (for Android Studio and IntelliJ)
72+
com_crashlytics_export_strings.xml
73+
crashlytics.properties
74+
crashlytics-build.properties
75+
### SVN template
76+
.svn/
77+
### Xcode template
78+
# Xcode
79+
#
80+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
81+
82+
## Build generated
83+
build/
84+
DerivedData
85+
86+
## Various settings
87+
*.pbxuser
88+
!default.pbxuser
89+
*.mode1v3
90+
!default.mode1v3
91+
*.mode2v3
92+
!default.mode2v3
93+
*.perspectivev3
94+
!default.perspectivev3
95+
xcuserdata
96+
97+
## Other
98+
*.xccheckout
99+
*.moved-aside
100+
*.xcuserstate
101+
102+
# Created by .ignore support plugin (hsz.mobi)

src/BriskyAPI.php

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
/**
4+
* Include a CSS or JS static resource by name. This function records a
5+
* dependency for the current page, so when a response is generated it can be
6+
* included. You can call this method from any context, and it is recommended
7+
* you invoke it as close to the actual dependency as possible so that page
8+
* dependencies are minimized.
9+
*
10+
* For more information, see @{article:Adding New CSS and JS}.
11+
*
12+
* @param string Name of the celerity module to include. This is whatever you
13+
* annotated as "@provides" in the file.
14+
* @return void
15+
*/
16+
function require_static_resource($symbol, $source_name = 'phabricator') {
17+
$response = BriskyAPI::getStaticResourceResponse();
18+
$response->requireResource($symbol, $source_name);
19+
}
20+
21+
22+
/**
23+
* Generate a node ID which is guaranteed to be unique for the current page,
24+
* even across Ajax requests. You should use this method to generate IDs for
25+
* nodes which require a uniqueness guarantee.
26+
*
27+
* @return string A string appropriate for use as an 'id' attribute on a DOM
28+
* node. It is guaranteed to be unique for the current page, even
29+
* if the current request is a subsequent Ajax request.
30+
*/
31+
function celerity_generate_unique_node_id() {
32+
static $uniq = 0;
33+
$response = BriskyAPI::getStaticResourceResponse();
34+
$block = $response->getMetadataBlock();
35+
36+
return 'UQ'.$block.'_'.($uniq++);
37+
}
38+
39+
40+
/**
41+
* Get the versioned URI for a raw resource, like an image.
42+
*
43+
* @param string Path to the raw image.
44+
* @return string Versioned path to the image, if one is available.
45+
*/
46+
function brisky_get_resource_uri($resource, $source = 'phabricator') {
47+
$resource = ltrim($resource, '/');
48+
49+
$map = BriskyResourceMap::getNamedInstance($source);
50+
$response = BriskyAPI::getStaticResourceResponse();
51+
return $response->getURI($map, $resource);
52+
}

src/BriskyPagelet.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: acemood
5+
* Date: 16-4-4
6+
* Time: 上午12:48
7+
*/
8+
9+
final class BriskyPagelet {
10+
11+
12+
13+
}

0 commit comments

Comments
 (0)