Merge lp:~marcustomlinson/unity-js-scopes/filters_example into lp:unity-js-scopes
- filters_example
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~marcustomlinson/unity-js-scopes/filters_example |
Merge into: | lp:unity-js-scopes |
Diff against target: |
904 lines (+800/-0) 10 files modified
examples/filters/CMakeLists.txt (+55/-0) examples/filters/filters.apparmor (+7/-0) examples/filters/manifest.json.in (+15/-0) examples/filters/po/CMakeLists.txt (+15/-0) examples/filters/po/POTFILES.in (+4/-0) examples/filters/po/POTFILES.in.in (+4/-0) examples/filters/src/CMakeLists.txt (+65/-0) examples/filters/src/data/filters-settings.ini.in (+1/-0) examples/filters/src/data/filters.ini.in (+7/-0) examples/filters/src/filters.js (+627/-0) |
To merge this branch: | bzr merge lp:~marcustomlinson/unity-js-scopes/filters_example |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
unity-api-1-bot | continuous-integration | Needs Fixing | |
WebApps | Pending | ||
Review via email: mp+294488@code.launchpad.net |
Commit message
Added "filters" example scope
Description of the change
unity-api-1-bot (unity-api-1-bot) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:143
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 144. By Marcus Tomlinson
-
Add missing copyright header
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:144
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:144
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
- 144. By Marcus Tomlinson
-
Add missing copyright header
- 143. By Marcus Tomlinson
-
Added "filters" example scope
Preview Diff
1 | === added directory 'examples/filters' | |||
2 | === added file 'examples/filters/CMakeLists.txt' | |||
3 | --- examples/filters/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
4 | +++ examples/filters/CMakeLists.txt 2016-05-12 12:36:01 +0000 | |||
5 | @@ -0,0 +1,55 @@ | |||
6 | 1 | project(filters) | ||
7 | 2 | cmake_minimum_required(VERSION 2.8.10) | ||
8 | 3 | |||
9 | 4 | # This is required to ensure the correct node modules are included in the project | ||
10 | 5 | execute_process(COMMAND unity-js-scopes-tool reinstall ${CMAKE_SOURCE_DIR}/src/node_modules unity-js-scopes) | ||
11 | 6 | add_custom_target(build_modules ALL COMMAND unity-js-scopes-tool rebuild ${CMAKE_SOURCE_DIR}/src/node_modules) | ||
12 | 7 | |||
13 | 8 | # Do not remove this, its required for the correct functionality of the Ubuntu-SDK | ||
14 | 9 | set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file") | ||
15 | 10 | set(UBUNTU_PROJECT_TYPE "Scope" CACHE INTERNAL "Tells QtCreator this is a Scope project") | ||
16 | 11 | |||
17 | 12 | # Important project paths | ||
18 | 13 | set(CMAKE_INSTALL_PREFIX /) | ||
19 | 14 | set(SCOPE_INSTALL_DIR "/filters") | ||
20 | 15 | set(GETTEXT_PACKAGE "filters") | ||
21 | 16 | set(PACKAGE_NAME "filters.marcustomlinson") | ||
22 | 17 | set(SCOPE_NAME "${PACKAGE_NAME}_filters") | ||
23 | 18 | |||
24 | 19 | # This command figures out the target architecture and puts it into the manifest file | ||
25 | 20 | execute_process( | ||
26 | 21 | COMMAND dpkg-architecture -qDEB_HOST_ARCH | ||
27 | 22 | OUTPUT_VARIABLE CLICK_ARCH | ||
28 | 23 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
29 | 24 | ) | ||
30 | 25 | |||
31 | 26 | # Install the manifest and apparmor files | ||
32 | 27 | configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) | ||
33 | 28 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION "/") | ||
34 | 29 | install(FILES "filters.apparmor" DESTINATION "/") | ||
35 | 30 | |||
36 | 31 | # Make these files show up in QtCreator | ||
37 | 32 | file(GLOB_RECURSE | ||
38 | 33 | _PO_JS_FILES | ||
39 | 34 | "po/*.po" | ||
40 | 35 | "po/*.pot" | ||
41 | 36 | "*.js" | ||
42 | 37 | ) | ||
43 | 38 | add_custom_target(hidden_files | ||
44 | 39 | ALL | ||
45 | 40 | SOURCES | ||
46 | 41 | manifest.json.in | ||
47 | 42 | filters.apparmor | ||
48 | 43 | src/data/filters.ini.in | ||
49 | 44 | src/data/filters-settings.ini.in | ||
50 | 45 | po/POTFILES.in.in | ||
51 | 46 | ${_PO_JS_FILES} | ||
52 | 47 | ) | ||
53 | 48 | |||
54 | 49 | # Search for our dependencies | ||
55 | 50 | find_package(Intltool) | ||
56 | 51 | |||
57 | 52 | # Add our main directories | ||
58 | 53 | add_subdirectory(po) | ||
59 | 54 | add_subdirectory(src) | ||
60 | 55 | |||
61 | 0 | 56 | ||
62 | === added file 'examples/filters/filters.apparmor' | |||
63 | --- examples/filters/filters.apparmor 1970-01-01 00:00:00 +0000 | |||
64 | +++ examples/filters/filters.apparmor 2016-05-12 12:36:01 +0000 | |||
65 | @@ -0,0 +1,7 @@ | |||
66 | 1 | { | ||
67 | 2 | "template": "ubuntu-scope-network", | ||
68 | 3 | "policy_groups": [], | ||
69 | 4 | "policy_version": 1.3 | ||
70 | 5 | } | ||
71 | 6 | |||
72 | 7 | |||
73 | 0 | 8 | ||
74 | === added file 'examples/filters/manifest.json.in' | |||
75 | --- examples/filters/manifest.json.in 1970-01-01 00:00:00 +0000 | |||
76 | +++ examples/filters/manifest.json.in 2016-05-12 12:36:01 +0000 | |||
77 | @@ -0,0 +1,15 @@ | |||
78 | 1 | { | ||
79 | 2 | "architecture": "@CLICK_ARCH@", | ||
80 | 3 | "description": "A simple Unity scope written in JavaScript", | ||
81 | 4 | "framework": "ubuntu-sdk-15.04.5", | ||
82 | 5 | "hooks": { | ||
83 | 6 | "filters": { | ||
84 | 7 | "apparmor": "filters.apparmor", | ||
85 | 8 | "scope": "filters" | ||
86 | 9 | } | ||
87 | 10 | }, | ||
88 | 11 | "maintainer": "Marcus Tomlinson <marcus.tomlinson@canonical.com>", | ||
89 | 12 | "name": "filters.marcustomlinson", | ||
90 | 13 | "title": "filters", | ||
91 | 14 | "version": "0.1" | ||
92 | 15 | } | ||
93 | 0 | 16 | ||
94 | === added directory 'examples/filters/po' | |||
95 | === added file 'examples/filters/po/CMakeLists.txt' | |||
96 | --- examples/filters/po/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
97 | +++ examples/filters/po/CMakeLists.txt 2016-05-12 12:36:01 +0000 | |||
98 | @@ -0,0 +1,15 @@ | |||
99 | 1 | intltool_update_potfile( | ||
100 | 2 | ALL | ||
101 | 3 | KEYWORDS "tr" "tr:1,2" "dtr:2" "dtr:2,3" "N_" | ||
102 | 4 | COPYRIGHT_HOLDER "" | ||
103 | 5 | POTFILES_TEMPLATE "POTFILES.in.in" | ||
104 | 6 | GETTEXT_PACKAGE ${GETTEXT_PACKAGE} | ||
105 | 7 | ) | ||
106 | 8 | |||
107 | 9 | intltool_install_translations( | ||
108 | 10 | ALL | ||
109 | 11 | GETTEXT_PACKAGE ${GETTEXT_PACKAGE} | ||
110 | 12 | ) | ||
111 | 13 | |||
112 | 14 | |||
113 | 15 | |||
114 | 0 | 16 | ||
115 | === added file 'examples/filters/po/POTFILES.in' | |||
116 | --- examples/filters/po/POTFILES.in 1970-01-01 00:00:00 +0000 | |||
117 | +++ examples/filters/po/POTFILES.in 2016-05-12 12:36:01 +0000 | |||
118 | @@ -0,0 +1,4 @@ | |||
119 | 1 | [type: gettext/ini] src/data/filters.ini.in | ||
120 | 2 | [type: gettext/ini] src/data/filters-settings.ini.in | ||
121 | 3 | |||
122 | 4 | |||
123 | 0 | 5 | ||
124 | === added file 'examples/filters/po/POTFILES.in.in' | |||
125 | --- examples/filters/po/POTFILES.in.in 1970-01-01 00:00:00 +0000 | |||
126 | +++ examples/filters/po/POTFILES.in.in 2016-05-12 12:36:01 +0000 | |||
127 | @@ -0,0 +1,4 @@ | |||
128 | 1 | [type: gettext/ini] src/data/filters.ini.in | ||
129 | 2 | [type: gettext/ini] src/data/filters-settings.ini.in | ||
130 | 3 | @GENERATED_POTFILES@ | ||
131 | 4 | |||
132 | 0 | 5 | ||
133 | === added directory 'examples/filters/src' | |||
134 | === added file 'examples/filters/src/CMakeLists.txt' | |||
135 | --- examples/filters/src/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
136 | +++ examples/filters/src/CMakeLists.txt 2016-05-12 12:36:01 +0000 | |||
137 | @@ -0,0 +1,65 @@ | |||
138 | 1 | # Put the ini, image, and js files in the build directory next | ||
139 | 2 | # to the scope .so file so test tools can find them easily. | ||
140 | 3 | intltool_merge_translations( | ||
141 | 4 | "data/filters.ini.in" | ||
142 | 5 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini" | ||
143 | 6 | ALL UTF8 | ||
144 | 7 | ) | ||
145 | 8 | intltool_merge_translations( | ||
146 | 9 | "data/filters-settings.ini.in" | ||
147 | 10 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}-settings.ini" | ||
148 | 11 | ALL UTF8 | ||
149 | 12 | ) | ||
150 | 13 | |||
151 | 14 | configure_file( | ||
152 | 15 | "data/icon.png" | ||
153 | 16 | "${CMAKE_CURRENT_BINARY_DIR}/icon.png" | ||
154 | 17 | @ONLY COPYONLY | ||
155 | 18 | ) | ||
156 | 19 | configure_file( | ||
157 | 20 | "data/logo.png" | ||
158 | 21 | "${CMAKE_CURRENT_BINARY_DIR}/logo.png" | ||
159 | 22 | @ONLY COPYONLY | ||
160 | 23 | ) | ||
161 | 24 | |||
162 | 25 | configure_file( | ||
163 | 26 | "filters.js" | ||
164 | 27 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.js" | ||
165 | 28 | @ONLY COPYONLY | ||
166 | 29 | ) | ||
167 | 30 | |||
168 | 31 | add_custom_target( | ||
169 | 32 | copy_modules ALL | ||
170 | 33 | COMMAND ${CMAKE_COMMAND} -E create_symlink | ||
171 | 34 | "${CMAKE_CURRENT_SOURCE_DIR}/node_modules" | ||
172 | 35 | "${CMAKE_CURRENT_BINARY_DIR}/node_modules" | ||
173 | 36 | ) | ||
174 | 37 | |||
175 | 38 | add_custom_target( | ||
176 | 39 | copy_covers ALL | ||
177 | 40 | COMMAND ${CMAKE_COMMAND} -E create_symlink | ||
178 | 41 | "${CMAKE_CURRENT_SOURCE_DIR}/data/covers" | ||
179 | 42 | "${CMAKE_CURRENT_BINARY_DIR}/covers" | ||
180 | 43 | ) | ||
181 | 44 | |||
182 | 45 | # Install the scope ini, image, and js files | ||
183 | 46 | install( | ||
184 | 47 | FILES | ||
185 | 48 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini" | ||
186 | 49 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}-settings.ini" | ||
187 | 50 | "${CMAKE_CURRENT_BINARY_DIR}/icon.png" | ||
188 | 51 | "${CMAKE_CURRENT_BINARY_DIR}/logo.png" | ||
189 | 52 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.js" | ||
190 | 53 | DESTINATION | ||
191 | 54 | ${SCOPE_INSTALL_DIR} | ||
192 | 55 | ) | ||
193 | 56 | |||
194 | 57 | install( | ||
195 | 58 | DIRECTORY | ||
196 | 59 | "${CMAKE_CURRENT_SOURCE_DIR}/node_modules" | ||
197 | 60 | "${CMAKE_CURRENT_SOURCE_DIR}/data/covers" | ||
198 | 61 | DESTINATION | ||
199 | 62 | ${SCOPE_INSTALL_DIR} | ||
200 | 63 | USE_SOURCE_PERMISSIONS | ||
201 | 64 | ) | ||
202 | 65 | |||
203 | 0 | 66 | ||
204 | === added directory 'examples/filters/src/data' | |||
205 | === added directory 'examples/filters/src/data/covers' | |||
206 | === added directory 'examples/filters/src/data/covers/childrens' | |||
207 | === added file 'examples/filters/src/data/covers/childrens/1.jpg' | |||
208 | 1 | Binary files examples/filters/src/data/covers/childrens/1.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/1.jpg 2016-05-12 12:36:01 +0000 differ | 67 | Binary files examples/filters/src/data/covers/childrens/1.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/1.jpg 2016-05-12 12:36:01 +0000 differ |
209 | === added file 'examples/filters/src/data/covers/childrens/10.jpg' | |||
210 | 2 | Binary files examples/filters/src/data/covers/childrens/10.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/10.jpg 2016-05-12 12:36:01 +0000 differ | 68 | Binary files examples/filters/src/data/covers/childrens/10.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/10.jpg 2016-05-12 12:36:01 +0000 differ |
211 | === added file 'examples/filters/src/data/covers/childrens/2.jpg' | |||
212 | 3 | Binary files examples/filters/src/data/covers/childrens/2.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/2.jpg 2016-05-12 12:36:01 +0000 differ | 69 | Binary files examples/filters/src/data/covers/childrens/2.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/2.jpg 2016-05-12 12:36:01 +0000 differ |
213 | === added file 'examples/filters/src/data/covers/childrens/3.jpg' | |||
214 | 4 | Binary files examples/filters/src/data/covers/childrens/3.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/3.jpg 2016-05-12 12:36:01 +0000 differ | 70 | Binary files examples/filters/src/data/covers/childrens/3.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/3.jpg 2016-05-12 12:36:01 +0000 differ |
215 | === added file 'examples/filters/src/data/covers/childrens/4.jpg' | |||
216 | 5 | Binary files examples/filters/src/data/covers/childrens/4.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/4.jpg 2016-05-12 12:36:01 +0000 differ | 71 | Binary files examples/filters/src/data/covers/childrens/4.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/4.jpg 2016-05-12 12:36:01 +0000 differ |
217 | === added file 'examples/filters/src/data/covers/childrens/5.jpg' | |||
218 | 6 | Binary files examples/filters/src/data/covers/childrens/5.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/5.jpg 2016-05-12 12:36:01 +0000 differ | 72 | Binary files examples/filters/src/data/covers/childrens/5.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/5.jpg 2016-05-12 12:36:01 +0000 differ |
219 | === added file 'examples/filters/src/data/covers/childrens/6.jpg' | |||
220 | 7 | Binary files examples/filters/src/data/covers/childrens/6.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/6.jpg 2016-05-12 12:36:01 +0000 differ | 73 | Binary files examples/filters/src/data/covers/childrens/6.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/6.jpg 2016-05-12 12:36:01 +0000 differ |
221 | === added file 'examples/filters/src/data/covers/childrens/7.jpg' | |||
222 | 8 | Binary files examples/filters/src/data/covers/childrens/7.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/7.jpg 2016-05-12 12:36:01 +0000 differ | 74 | Binary files examples/filters/src/data/covers/childrens/7.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/7.jpg 2016-05-12 12:36:01 +0000 differ |
223 | === added file 'examples/filters/src/data/covers/childrens/8.jpg' | |||
224 | 9 | Binary files examples/filters/src/data/covers/childrens/8.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/8.jpg 2016-05-12 12:36:01 +0000 differ | 75 | Binary files examples/filters/src/data/covers/childrens/8.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/8.jpg 2016-05-12 12:36:01 +0000 differ |
225 | === added file 'examples/filters/src/data/covers/childrens/9.jpg' | |||
226 | 10 | Binary files examples/filters/src/data/covers/childrens/9.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/9.jpg 2016-05-12 12:36:01 +0000 differ | 76 | Binary files examples/filters/src/data/covers/childrens/9.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/childrens/9.jpg 2016-05-12 12:36:01 +0000 differ |
227 | === added directory 'examples/filters/src/data/covers/fiction' | |||
228 | === added file 'examples/filters/src/data/covers/fiction/1.jpg' | |||
229 | 11 | Binary files examples/filters/src/data/covers/fiction/1.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/1.jpg 2016-05-12 12:36:01 +0000 differ | 77 | Binary files examples/filters/src/data/covers/fiction/1.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/1.jpg 2016-05-12 12:36:01 +0000 differ |
230 | === added file 'examples/filters/src/data/covers/fiction/10.jpg' | |||
231 | 12 | Binary files examples/filters/src/data/covers/fiction/10.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/10.jpg 2016-05-12 12:36:01 +0000 differ | 78 | Binary files examples/filters/src/data/covers/fiction/10.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/10.jpg 2016-05-12 12:36:01 +0000 differ |
232 | === added file 'examples/filters/src/data/covers/fiction/11.jpg' | |||
233 | 13 | Binary files examples/filters/src/data/covers/fiction/11.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/11.jpg 2016-05-12 12:36:01 +0000 differ | 79 | Binary files examples/filters/src/data/covers/fiction/11.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/11.jpg 2016-05-12 12:36:01 +0000 differ |
234 | === added file 'examples/filters/src/data/covers/fiction/12.jpg' | |||
235 | 14 | Binary files examples/filters/src/data/covers/fiction/12.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/12.jpg 2016-05-12 12:36:01 +0000 differ | 80 | Binary files examples/filters/src/data/covers/fiction/12.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/12.jpg 2016-05-12 12:36:01 +0000 differ |
236 | === added file 'examples/filters/src/data/covers/fiction/2.jpg' | |||
237 | 15 | Binary files examples/filters/src/data/covers/fiction/2.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/2.jpg 2016-05-12 12:36:01 +0000 differ | 81 | Binary files examples/filters/src/data/covers/fiction/2.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/2.jpg 2016-05-12 12:36:01 +0000 differ |
238 | === added file 'examples/filters/src/data/covers/fiction/3.jpg' | |||
239 | 16 | Binary files examples/filters/src/data/covers/fiction/3.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/3.jpg 2016-05-12 12:36:01 +0000 differ | 82 | Binary files examples/filters/src/data/covers/fiction/3.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/3.jpg 2016-05-12 12:36:01 +0000 differ |
240 | === added file 'examples/filters/src/data/covers/fiction/4.jpg' | |||
241 | 17 | Binary files examples/filters/src/data/covers/fiction/4.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/4.jpg 2016-05-12 12:36:01 +0000 differ | 83 | Binary files examples/filters/src/data/covers/fiction/4.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/4.jpg 2016-05-12 12:36:01 +0000 differ |
242 | === added file 'examples/filters/src/data/covers/fiction/5.jpg' | |||
243 | 18 | Binary files examples/filters/src/data/covers/fiction/5.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/5.jpg 2016-05-12 12:36:01 +0000 differ | 84 | Binary files examples/filters/src/data/covers/fiction/5.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/5.jpg 2016-05-12 12:36:01 +0000 differ |
244 | === added file 'examples/filters/src/data/covers/fiction/6.jpg' | |||
245 | 19 | Binary files examples/filters/src/data/covers/fiction/6.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/6.jpg 2016-05-12 12:36:01 +0000 differ | 85 | Binary files examples/filters/src/data/covers/fiction/6.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/6.jpg 2016-05-12 12:36:01 +0000 differ |
246 | === added file 'examples/filters/src/data/covers/fiction/7.jpg' | |||
247 | 20 | Binary files examples/filters/src/data/covers/fiction/7.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/7.jpg 2016-05-12 12:36:01 +0000 differ | 86 | Binary files examples/filters/src/data/covers/fiction/7.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/7.jpg 2016-05-12 12:36:01 +0000 differ |
248 | === added file 'examples/filters/src/data/covers/fiction/8.jpg' | |||
249 | 21 | Binary files examples/filters/src/data/covers/fiction/8.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/8.jpg 2016-05-12 12:36:01 +0000 differ | 87 | Binary files examples/filters/src/data/covers/fiction/8.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/8.jpg 2016-05-12 12:36:01 +0000 differ |
250 | === added file 'examples/filters/src/data/covers/fiction/9.jpg' | |||
251 | 22 | Binary files examples/filters/src/data/covers/fiction/9.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/9.jpg 2016-05-12 12:36:01 +0000 differ | 88 | Binary files examples/filters/src/data/covers/fiction/9.jpg 1970-01-01 00:00:00 +0000 and examples/filters/src/data/covers/fiction/9.jpg 2016-05-12 12:36:01 +0000 differ |
252 | === added file 'examples/filters/src/data/filters-settings.ini.in' | |||
253 | --- examples/filters/src/data/filters-settings.ini.in 1970-01-01 00:00:00 +0000 | |||
254 | +++ examples/filters/src/data/filters-settings.ini.in 2016-05-12 12:36:01 +0000 | |||
255 | @@ -0,0 +1,1 @@ | |||
256 | 1 | |||
257 | 0 | 2 | ||
258 | === added file 'examples/filters/src/data/filters.ini.in' | |||
259 | --- examples/filters/src/data/filters.ini.in 1970-01-01 00:00:00 +0000 | |||
260 | +++ examples/filters/src/data/filters.ini.in 2016-05-12 12:36:01 +0000 | |||
261 | @@ -0,0 +1,7 @@ | |||
262 | 1 | [ScopeConfig] | ||
263 | 2 | ScopeRunner=./node_modules/unity-js-scopes/bin/unity-js-scopes-launcher %S %R | ||
264 | 3 | _DisplayName=Books (JavaScript) | ||
265 | 4 | _Description=This is a Books scope for testing purposes | ||
266 | 5 | Art=screenshot.png | ||
267 | 6 | Author = Canonical Ltd. | ||
268 | 7 | Icon = icon.png | ||
269 | 0 | 8 | ||
270 | === added file 'examples/filters/src/data/icon.png' | |||
271 | 1 | Binary files examples/filters/src/data/icon.png 1970-01-01 00:00:00 +0000 and examples/filters/src/data/icon.png 2016-05-12 12:36:01 +0000 differ | 9 | Binary files examples/filters/src/data/icon.png 1970-01-01 00:00:00 +0000 and examples/filters/src/data/icon.png 2016-05-12 12:36:01 +0000 differ |
272 | === added file 'examples/filters/src/data/logo.png' | |||
273 | 2 | Binary files examples/filters/src/data/logo.png 1970-01-01 00:00:00 +0000 and examples/filters/src/data/logo.png 2016-05-12 12:36:01 +0000 differ | 10 | Binary files examples/filters/src/data/logo.png 1970-01-01 00:00:00 +0000 and examples/filters/src/data/logo.png 2016-05-12 12:36:01 +0000 differ |
274 | === added file 'examples/filters/src/filters.js' | |||
275 | --- examples/filters/src/filters.js 1970-01-01 00:00:00 +0000 | |||
276 | +++ examples/filters/src/filters.js 2016-05-12 12:36:01 +0000 | |||
277 | @@ -0,0 +1,627 @@ | |||
278 | 1 | /* | ||
279 | 2 | * Copyright 2016 Canonical Ltd. | ||
280 | 3 | * | ||
281 | 4 | * This file is part of unity-js-scopes. | ||
282 | 5 | * | ||
283 | 6 | * unity-js-scopes is free software; you can redistribute it and/or modify | ||
284 | 7 | * it under the terms of the GNU General Public License as published by | ||
285 | 8 | * the Free Software Foundation; version 3. | ||
286 | 9 | * | ||
287 | 10 | * unity-js-scopes is distributed in the hope that it will be useful, | ||
288 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
289 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
290 | 13 | * GNU General Public License for more details. | ||
291 | 14 | * | ||
292 | 15 | * You should have received a copy of the GNU General Public License | ||
293 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
294 | 17 | */ | ||
295 | 18 | |||
296 | 19 | var scopes = require('unity-js-scopes') | ||
297 | 20 | |||
298 | 21 | var CATEGORY_TEMPLATE = | ||
299 | 22 | { | ||
300 | 23 | "schema-version": 1, | ||
301 | 24 | "template": { | ||
302 | 25 | "category-layout": "grid", | ||
303 | 26 | "card-layout": "horizontal", | ||
304 | 27 | "card-size": "medium" | ||
305 | 28 | }, | ||
306 | 29 | "components": { | ||
307 | 30 | "title": "title", | ||
308 | 31 | "art" : { | ||
309 | 32 | "field": "art" | ||
310 | 33 | }, | ||
311 | 34 | "subtitle": "subtitle", | ||
312 | 35 | "attributes": { | ||
313 | 36 | "field": "attributes", | ||
314 | 37 | "max-count": 2 | ||
315 | 38 | } | ||
316 | 39 | } | ||
317 | 40 | } | ||
318 | 41 | |||
319 | 42 | var books = []; | ||
320 | 43 | |||
321 | 44 | function book(titlev, formatv, authorv, pricev, ratingv, departmentv, categoryv, synopsisv, artv) | ||
322 | 45 | { | ||
323 | 46 | return { | ||
324 | 47 | title: titlev, | ||
325 | 48 | format: formatv, | ||
326 | 49 | author: authorv, | ||
327 | 50 | price: pricev, | ||
328 | 51 | rating: ratingv, | ||
329 | 52 | department: departmentv, | ||
330 | 53 | category: categoryv, | ||
331 | 54 | synopsis: synopsisv, | ||
332 | 55 | art: artv, | ||
333 | 56 | } | ||
334 | 57 | } | ||
335 | 58 | |||
336 | 59 | books.push(book( | ||
337 | 60 | "Your Heart is a Muscle the Size of a Fist", | ||
338 | 61 | "hardback", | ||
339 | 62 | "Sunil Yapa", | ||
340 | 63 | 14.99, | ||
341 | 64 | 3, | ||
342 | 65 | "fiction", | ||
343 | 66 | "bestseller", | ||
344 | 67 | "A heart-stopping debut about protest and riot ...1999. Victor, homeless after a family tragedy, finds himself pounding the streets of Seattle with little meaning or purpose. He is the estranged son of the police chief of the city, and today his father is in charge of one of the largest protests in the history of Western democracy. But in a matter of hours reality will become a nightmare. Hordes of protesters - from all sections of society - will test the patience of the city's police force, and lives will be altered forever: two armed police officers will struggle to keep calm amid the threat of violence; a protester with a murderous past will make an unforgivable mistake; and a delegate from Sri Lanka will do whatever it takes to make it through the crowd to a meeting - a meeting that could dramatically change the fate of his country. In amongst the fray, Victor and his father are heading for a collision too. Your Heart is a Muscle the Size of a Fist, set during the World Trade Organization protests, is a deeply charged novel showcasing a distinct and exciting new literary voice.", | ||
345 | 68 | "1.jpg" | ||
346 | 69 | ) | ||
347 | 70 | ); | ||
348 | 71 | |||
349 | 72 | books.push(book( | ||
350 | 73 | "Gold Fame Citrus", | ||
351 | 74 | "hardback", | ||
352 | 75 | "Claire Vaye Watkins", | ||
353 | 76 | 16.99, | ||
354 | 77 | 4, | ||
355 | 78 | "fiction", | ||
356 | 79 | "book of the month", | ||
357 | 80 | "Desert sands have laid waste to the south-west of America. Las Vegas is buried. California - and anyone still there - is stranded. Any way out is severely restricted. But Luz and Ray are not leaving. They survive on water rations, black market fruit and each other's need. Luz needs Ray, and Ray must be needed. But then they cross paths with a mysterious child, and the thirst for a better future begins. It's said there's a man on the edge of the Dune Sea. He leads a camp of believers. He can find water. Venturing into this dry heart of darkness, Luz thinks she has found their saviour. For the will to survive taps hidden powers; and the needed, and the needy, will exploit it. Like Margaret Atwood, Claire Vaye Watkins uses dystopia to traverse the scarred frontier of the heart, exploring the myths we tell about others and ourselves. In her bare and brilliant prose, nature and human nature, conspiracy and cult, motherhood and manhood are played out across the vast, implacable desert.", | ||
358 | 81 | "2.jpg" | ||
359 | 82 | ) | ||
360 | 83 | ); | ||
361 | 84 | |||
362 | 85 | books.push(book( | ||
363 | 86 | "Love + Hate: Stories and Essay", | ||
364 | 87 | "paperback", | ||
365 | 88 | "Hanif Kureishi", | ||
366 | 89 | 9.99, | ||
367 | 90 | 5, | ||
368 | 91 | "fiction", | ||
369 | 92 | "bestseller", | ||
370 | 93 | "Hate skews reality even more than love. In the story of a Pakistani woman who has begun a new life in Paris, an essay about the writing of Kureishi's acclaimed film Le Week-End, and an account of Kafka's relationship with his father, readers will find Kureishi also exploring the topics that he continues to make new, and make his own: growing up and growing old; betrayal and loyalty; imagination and repression; marriage and fatherhood. The collection ends with a bravura piece of very personal reportage about the conman who stole Kureishi's life savings - a man who provoked both admiration and disgust, obsession and revulsion, love and hate.", | ||
371 | 94 | "3.jpg" | ||
372 | 95 | ) | ||
373 | 96 | ); | ||
374 | 97 | |||
375 | 98 | books.push(book( | ||
376 | 99 | "The Book of Speculation", | ||
377 | 100 | "audiobook", | ||
378 | 101 | "Erika Swyler", | ||
379 | 102 | 12.99, | ||
380 | 103 | 4, | ||
381 | 104 | "fiction", | ||
382 | 105 | "bestseller", | ||
383 | 106 | "Simon Watson lives alone on the Long Island Sound in his family home, a house perched on the edge of a cliff that is slowly crumbling into the sea. His parents are long dead, his mother having drowned in the water his house overlooks. His younger sister, Enola, works for a travelling carnival and seldom calls. On a day in late June, Simon receives a mysterious book from an antiquarian bookseller; it has been sent to him because it is inscribed with the name Verona Bonn, Simon's grandmother. The book tells the story of two doomed lovers who were part of a travelling circus more than two hundred years ago. The paper crackles with age as Simon turns the yellowed pages filled with notes and sketches. He is fascinated, yet as he reads Simon becomes increasingly unnerved. Why do so many women in his family drown on 24th July? And could Enola, who has suddenly turned up at home for the first time in years, risk the same terrible fate? As 24th July draws ever closer, Simon must unlock the mysteries of the book, and decode his family history, before it's too late.", | ||
384 | 107 | "4.jpg" | ||
385 | 108 | ) | ||
386 | 109 | ); | ||
387 | 110 | |||
388 | 111 | books.push(book( | ||
389 | 112 | "Rush Oh!", | ||
390 | 113 | "hardback", | ||
391 | 114 | "Shirley Barrett", | ||
392 | 115 | 14.99, | ||
393 | 116 | 4, | ||
394 | 117 | "fiction", | ||
395 | 118 | "bestseller", | ||
396 | 119 | "When Mary Davidson, the eldest daughter of a whaling family in Eden, New South Wales, sets out to chronicle the particularly difficult season of 1908, the story she tells is poignant and hilarious, filled with drama and misadventure. It's a season marked not only by the sparsity of whales and the vagaries of weather, but also by the arrival of John Beck, an itinerant whaleman with a murky past, on whom Mary promptly develops an all-consuming crush. But hers is not the only romance to blossom amidst the blubber ...Swinging from Mary's hopes and disappointments, both domestic and romantic, to the challenges that beset their tiny whaling operation, Rush Oh! is a celebration of an extraordinary episode in Australian history when a family of whalers formed a fond, unique alliance with a pod of frisky killer whales - and in particular, a killer whale named Tom.", | ||
397 | 120 | "5.jpg" | ||
398 | 121 | ) | ||
399 | 122 | ); | ||
400 | 123 | |||
401 | 124 | books.push(book( | ||
402 | 125 | "The High Mountains of Portugal", | ||
403 | 126 | "hardback", | ||
404 | 127 | "Yann Martel", | ||
405 | 128 | 18.99, | ||
406 | 129 | 3, | ||
407 | 130 | "fiction", | ||
408 | 131 | "special edition", | ||
409 | 132 | "Lost in Portugal. Lost to grief. With nothing but a chimpanzee. The extraordinary new novel from the author of Life of Pi. In Lisbon in 1904, a young man named Tomas discovers an old journal. It hints at the location of an extraordinary artefact that - if it exists - would redefine history. Travelling in one of Europe's earliest automobiles, he sets out in search of this treasure. Some thirty-five years later, a Portuguese pathologist finds himself at the centre of a murder mystery. Fifty years on, a Canadian senator takes refuge in northern Portugal, grieving the loss of his beloved wife. But he comes to his ancestral village with an unusual companion: a chimpanzee. Three stories. Three broken hearts. One exploration: what is a life without stories? The High Mountains of Portugal takes the reader on a road trip through Portugal in the last century - and through the human soul.", | ||
410 | 133 | "6.jpg" | ||
411 | 134 | ) | ||
412 | 135 | ); | ||
413 | 136 | |||
414 | 137 | books.push(book( | ||
415 | 138 | "Rebel of the Sands", | ||
416 | 139 | "audiobook", | ||
417 | 140 | "Alwyn Hamilton", | ||
418 | 141 | 7.99, | ||
419 | 142 | 3, | ||
420 | 143 | "fiction", | ||
421 | 144 | "recommended", | ||
422 | 145 | "Sold immediately at auction across the world, this phenomenal novel is the first in a trilogy packed with shooting contests, train robberies, festivals under the stars, powerful Djinni magic and an electrifying love story. This promises to be a global super lead. Tell me that and we'll go. Right now. Save ourselves and leave this place to burn. Tell me that's how you want your story to go and we'll write it straight across the sand.' Dustwalk is Amani's home. The desert sand is in her bones. But she wants to escape. More than a want. A need. Then a foreigner with no name turns up to save her life, and with him the chance to run. But to where? The desert plains are full of danger. Sand and blood are swirling, and the Sultan's enemies are on the rise.", | ||
423 | 146 | "7.jpg" | ||
424 | 147 | ) | ||
425 | 148 | ); | ||
426 | 149 | |||
427 | 150 | books.push(book( | ||
428 | 151 | "More of Me", | ||
429 | 152 | "paperback", | ||
430 | 153 | "Kathryn Evans", | ||
431 | 154 | 6.99, | ||
432 | 155 | 4, | ||
433 | 156 | "fiction", | ||
434 | 157 | "special edition", | ||
435 | 158 | "Teva seems normal. But at home she hides an impossible secret: 11 other Tevas. Because once a year, Teva splits into two, leaving a younger version of herself stuck at the same age, forced to watch the new Teva taking over her life. But at 16, Teva's had enough. She's going to fight for her future - even if that means fighting herself. Imagine all your friends growing up, moving on, and you being stuck in one year of your life...More of Me is an incredible, unforgettable story of identity, friendship, love and sacrifice.", | ||
436 | 159 | "8.jpg" | ||
437 | 160 | ) | ||
438 | 161 | ); | ||
439 | 162 | |||
440 | 163 | books.push(book( | ||
441 | 164 | "How Hard Can Love be?", | ||
442 | 165 | "paperback", | ||
443 | 166 | "Holly Bourne", | ||
444 | 167 | 7.99, | ||
445 | 168 | 4, | ||
446 | 169 | "fiction", | ||
447 | 170 | "recommended", | ||
448 | 171 | "Sorry, no synopsis is currently available.", | ||
449 | 172 | "9.jpg" | ||
450 | 173 | ) | ||
451 | 174 | ); | ||
452 | 175 | |||
453 | 176 | books.push(book( | ||
454 | 177 | "How Not to Disappear", | ||
455 | 178 | "hardback", | ||
456 | 179 | "Clare Furniss", | ||
457 | 180 | 12.99, | ||
458 | 181 | 3, | ||
459 | 182 | "fiction", | ||
460 | 183 | "recommended", | ||
461 | 184 | "Our memories are what make us who we are. Some are real. Some are made up. But they are the stories that tell us who we are. Without them we are nobody.Hattie's summer isn't going as planned. Her two best friends have abandoned her: Reuben has run off to Europe to 'find himself' and Kat is in Edinburgh with her new girlfriend. Meanwhile Hattie is stuck babysitting her twin siblings and dealing with endless drama around her mum's wedding. Oh, and she's also just discovered that she's pregnant with Reuben's baby...Then Gloria, Hattie's great-aunt who no one even knew existed, comes crashing into her life. Gloria's fiercely independent, rather too fond of a gin sling and is in the early stages of dementia. Together the two of them set out on a road trip of self-discovery - Gloria to finally confront the secrets of her past before they are erased from her memory forever and Hattie to face the hard choices that will determine her future...Non Pratt's Trouble meets Thelma and Louise with a touch of Elizabeth is Missing by Emma Healey, Clare Furniss' remarkable How Not To Disappear is an emotional rollercoaster of a novel that will make you laugh and break your heart.", | ||
462 | 185 | "10.jpg" | ||
463 | 186 | ) | ||
464 | 187 | ); | ||
465 | 188 | |||
466 | 189 | books.push(book( | ||
467 | 190 | "Front Lines", | ||
468 | 191 | "paperback", | ||
469 | 192 | "Michael Grant", | ||
470 | 193 | 7.99, | ||
471 | 194 | 2, | ||
472 | 195 | "fiction", | ||
473 | 196 | "recommended", | ||
474 | 197 | "Just when you thought Michael Grant's Gone series had taken us to the darkest limits of his imagination, the evil genius of YA fiction is back to take you to the Front Lines of terror. In the tradition of The Book Thie, Code Name Verity and Between Shades of Gray, Front Lines gives the experience of WWII a new immediacy while playing with the 'what ifs?' of history. It's WWII, but not as you remember it from history lessons! This time the girls aren't stitching socks for the brave boys at the front. Meet Rio Richilin and her friends Frangie Marr and Rainy Schulterman, three of the newest recruits in the US Armed Forces. They stand shoulder to shoulder with the boys from home as they take on Hitler's army. In the face of reluctant colonels and sceptical sergeants, the soldier girls must prove their guts, strength, and resourcefulness as soldiers. Rio has grown up in a world where men don't cry and girls are supposed to care only about 'money and looks'. But she has always known that there is something wrong with this system and something else in her. Far from home and in the battlefields, Rio discovers exactly who she is and what she can accomplish.", | ||
475 | 198 | "11.jpg" | ||
476 | 199 | ) | ||
477 | 200 | ); | ||
478 | 201 | |||
479 | 202 | books.push(book( | ||
480 | 203 | "All the Rage", | ||
481 | 204 | "paperback", | ||
482 | 205 | "Courtney Summers", | ||
483 | 206 | 17.99, | ||
484 | 207 | 5, | ||
485 | 208 | "fiction", | ||
486 | 209 | "special edition", | ||
487 | 210 | "The footsteps stop but the birds are still singing, singing about a girl who wakes up on a dirt road and doesn't know what happened to her the night before...' Romy Grey wears her lipstick like armour, ever since the night she was raped by Kellan Turner, the sheriff's son. Romy refuses to be a victim, but speaking up has cost her everything. No one wants to believe Kellan is not the golden boy they thought he was, and Romy has given up trying to make herself heard. But when another girl goes missing after a party, Romy must decide whether the cost of her silence might be more than she can bear.", | ||
488 | 211 | "12.jpg" | ||
489 | 212 | ) | ||
490 | 213 | ); | ||
491 | 214 | |||
492 | 215 | books.push(book( | ||
493 | 216 | "Sticker Dolly Dressing Fashion Designer London Collection", | ||
494 | 217 | "hardback", | ||
495 | 218 | "Fiona Watt", | ||
496 | 219 | 6.99, | ||
497 | 220 | 2, | ||
498 | 221 | "childrens", | ||
499 | 222 | "recommended", | ||
500 | 223 | "London is one of the great fashion capitals of the world, and this book, with over 350 stickers - including 150 to colour yourself - allows young creatives to research, plan and design their own fashion collections, inspired by the city. With hints and tips on how to choose colours, patterns and shapes that work together.", | ||
501 | 224 | "1.jpg" | ||
502 | 225 | ) | ||
503 | 226 | ); | ||
504 | 227 | |||
505 | 228 | books.push(book( | ||
506 | 229 | "Waiting for Callback", | ||
507 | 230 | "paperback", | ||
508 | 231 | "Perdita Cargill", | ||
509 | 232 | 6.99, | ||
510 | 233 | 3, | ||
511 | 234 | "childrens", | ||
512 | 235 | "recommended", | ||
513 | 236 | "Geek Girl meets Fame meets New Girl in this brilliantly funny new series! When Elektra is discovered by an acting agent, she imagines Oscar glory can't be far away, but instead lurches from one cringe-worthy moment to the next! Just how many times can you be rejected for the part of 'Dead Girl Number Three' without losing hope? And who knew that actors were actually supposed to be multi-lingual, play seven instruments and be trained in a variety of circus skills? Off-stage things aren't going well either - she's fallen out with her best friend, remains firmly in the friend-zone with her crush and her parents are driving her crazy. One way or another, Elektra's life is now spent waiting for the phone to ring - waiting for callback. Can an average girl-next-door like Elektra really make it in the world of luvvies and starlets?", | ||
514 | 237 | "2.jpg" | ||
515 | 238 | ) | ||
516 | 239 | ); | ||
517 | 240 | |||
518 | 241 | books.push(book( | ||
519 | 242 | "Anna and the Swallow Man", | ||
520 | 243 | "hardback", | ||
521 | 244 | "Gavriel Savit", | ||
522 | 245 | 9.99, | ||
523 | 246 | 4, | ||
524 | 247 | "childrens", | ||
525 | 248 | "special edition", | ||
526 | 249 | "Anna and the Swallow Man is a stunning, literary, and wholly original debut novel that tells a new WW2 story. Krakow, 1939, is no place to grow up. There are a million marching soldiers and a thousand barking dogs. And Anna Lania is just seven years old when the Germans take her father and suddenly, she's alone. Then she meets the Swallow Man. He is a mystery, strange and tall. And like Anna's missing father, he has a gift for languages: Polish, Russian, German, Yiddish, even Bird. When he summons a bright, beautiful swallow down to his hand to stop her from crying, Anna is entranced. Over the course of their travels together, Anna and the Swallow Man will dodge bombs, tame soldiers, and even, despite their better judgement, make a friend. But in a world gone mad, everything can prove dangerous...", | ||
527 | 250 | "3.jpg" | ||
528 | 251 | ) | ||
529 | 252 | ); | ||
530 | 253 | |||
531 | 254 | books.push(book( | ||
532 | 255 | "Time Travelling with a Hamster", | ||
533 | 256 | "paperback", | ||
534 | 257 | "Ross Welford", | ||
535 | 258 | 16.99, | ||
536 | 259 | 3, | ||
537 | 260 | "childrens", | ||
538 | 261 | "bestseller", | ||
539 | 262 | "A truly original debut novel from an extraordinarily talented new voice in children's books. Laugh, cry and wonder at this race-against-time story of a boy who travels back to 1984 to prevent a go-kart accident, and save his father's life...'My dad died twice. Once when he was thirty nine and again four years later when he was twelve. The first time had nothing to do with me. The second time definitely did, but I would never even have been there if it hadn't been for his 'time machine'...\" When Al Chaudhury discovers his late dad's time machine, he finds that going back to the 1980s requires daring and imagination. It also requires lies, theft, burglary, and setting his school on fire. All without losing his pet hamster, Alan Shearer...", | ||
540 | 263 | "4.jpg" | ||
541 | 264 | ) | ||
542 | 265 | ); | ||
543 | 266 | |||
544 | 267 | books.push(book( | ||
545 | 268 | "The Long Haul", | ||
546 | 269 | "paperback", | ||
547 | 270 | "Jeff Kinney", | ||
548 | 271 | 9.99, | ||
549 | 272 | 3, | ||
550 | 273 | "childrens", | ||
551 | 274 | "recommended", | ||
552 | 275 | "A family road trip is supposed to be a lot of fun ...unless, of course, you're the Heffleys. The journey starts off full of promise, then quickly takes several wrong turns. Gas station bathrooms, crazed seagulls, a fender bender, and a runaway pig - not exactly Greg Heffley's idea of a good time. But even the worst road trip can turn into an adventure - and this is one the Heffleys won't soon forget. Zoo-Wee-Mama! Includes exclusive bumper stickers!", | ||
553 | 276 | "5.jpg" | ||
554 | 277 | ) | ||
555 | 278 | ); | ||
556 | 279 | |||
557 | 280 | books.push(book( | ||
558 | 281 | "Barry Loser Hates Half Term", | ||
559 | 282 | "audiobook", | ||
560 | 283 | "Jim Smith", | ||
561 | 284 | 12.99, | ||
562 | 285 | 4, | ||
563 | 286 | "childrens", | ||
564 | 287 | "recommended", | ||
565 | 288 | "This is the seventh book in the brilliant Roald Dahl Funny Prize award-winning series Barry Loser. Suitable for fans of Diary of a Wimpy Kid and Tom Gates. It's only a few days into the half-term holidays and Barry's dad has already had enough of him! He's packing Barry off to Pirate Camp, the same one he used to be sent to every year. Barry's not impressed - he's not a baby anymore, so why should he have to go to a camp for kiddy winkles? But horrible things are a foot at Pirate Camp - it's been taken over by the villainous Morag, and now its future's in doubt. There's only one thing to do: Barry and his new friends Sally Bottom and Renard Dupont have to uncover the hidden treasure of Mogden Island...Join everyone's favourite Loser on his seventh hilarious adventure!", | ||
566 | 289 | "6.jpg" | ||
567 | 290 | ) | ||
568 | 291 | ); | ||
569 | 292 | |||
570 | 293 | books.push(book( | ||
571 | 294 | "The Butterfly Club", | ||
572 | 295 | "paperback", | ||
573 | 296 | "Jacqueline Wilson", | ||
574 | 297 | 9.99, | ||
575 | 298 | 3, | ||
576 | 299 | "childrens", | ||
577 | 300 | "recommended", | ||
578 | 301 | "Tina is a triplet, but she's always been the odd one out. Her sisters Phil and Maddie are bigger and stronger and better at just about everything. Luckily, they look after teeny-tiny Tina wherever they go - but when the girls start in scary, super-strict Miss Lovejoy's class, they're split up, and Tina has to fend for herself for the first time. Tina is horrified when she's paired up with angry bully Selma, who nobody wants to be friends with. But when Miss Lovejoy asks them to help her create a butterfly garden in the school playground, Tina discovers she doesn't always need her sisters - and that there's a lot more to Selma than first meets the eye. This is a beautiful, heartwarming story about friendship, confidence and becoming your own person, from the mega-bestselling author of Tracy Beaker, Hetty Feather and Sleepovers.", | ||
579 | 302 | "7.jpg" | ||
580 | 303 | ) | ||
581 | 304 | ); | ||
582 | 305 | |||
583 | 306 | books.push(book( | ||
584 | 307 | "Over 100 Animal Doodles", | ||
585 | 308 | "paperback", | ||
586 | 309 | "Fiona Watt", | ||
587 | 310 | 11.99, | ||
588 | 311 | 4, | ||
589 | 312 | "childrens", | ||
590 | 313 | "recommended", | ||
591 | 314 | "Lots of simple instructions that will allow children to draw a range of animals with satisfying results. Learn step-by-step, with diagrams that explain how to use simple shapes to create animals - then practise drawing them again and again, creating scenes.", | ||
592 | 315 | "8.jpg" | ||
593 | 316 | ) | ||
594 | 317 | ); | ||
595 | 318 | |||
596 | 319 | books.push(book( | ||
597 | 320 | "Confessions of an Imaginary Friend", | ||
598 | 321 | "audiobook", | ||
599 | 322 | "Michelle Cuevas", | ||
600 | 323 | 14.99, | ||
601 | 324 | 3, | ||
602 | 325 | "childrens", | ||
603 | 326 | "bestseller", | ||
604 | 327 | "Jacques Papier thinks that everyone hates him. After all, teachers ignore him when he raises his hand in class, nobody ever picks him for sports teams, and his sister, Fleur, keeps having to remind their parents to set a place for him at the dinner table. But then Jacques discovers an uncomfortable truth: He is NOT Fleur's brother; he's her imaginary friend! And so begins Jacques' quest for identity ...what do you do when you realise that the only reason you exist is because of someone else's imagination? The whimsical \"autobiography\" of an imaginary friend who doesn't know he's imaginary - perfect for fans of Toy Story, The Imaginary and Moone Boy.", | ||
605 | 328 | "9.jpg" | ||
606 | 329 | ) | ||
607 | 330 | ); | ||
608 | 331 | |||
609 | 332 | books.push(book( | ||
610 | 333 | "Shaun the Sheep - the Farmer's Llamas", | ||
611 | 334 | "paperback", | ||
612 | 335 | "Aardman Animations Ltd", | ||
613 | 336 | 16.99, | ||
614 | 337 | 4, | ||
615 | 338 | "childrens", | ||
616 | 339 | "rook of the month", | ||
617 | 340 | "When a mix-up at the auction leads to a surprise win, the Farmer brings his prize animals - a trio of llamas - home to the farm. Shaun is thrilled, but are the new residents a baaad influence? Based on a one-of, half-hour TV episode, this junior novel includes full-colour stills from the special.", | ||
618 | 341 | "10.jpg" | ||
619 | 342 | ) | ||
620 | 343 | ); | ||
621 | 344 | |||
622 | 345 | function match(book, query, department, format, categories, min_price, max_price, rating) | ||
623 | 346 | { | ||
624 | 347 | if (department && book.department !== department) | ||
625 | 348 | { | ||
626 | 349 | return false; | ||
627 | 350 | } | ||
628 | 351 | |||
629 | 352 | if (format && book.format !== format) | ||
630 | 353 | { | ||
631 | 354 | return false; | ||
632 | 355 | } | ||
633 | 356 | |||
634 | 357 | if (categories.length && categories.indexOf(book.category) === -1) | ||
635 | 358 | { | ||
636 | 359 | return false; | ||
637 | 360 | } | ||
638 | 361 | |||
639 | 362 | if (book.price < min_price || book.price > max_price) | ||
640 | 363 | { | ||
641 | 364 | return false; | ||
642 | 365 | } | ||
643 | 366 | |||
644 | 367 | if (book.rating < rating) | ||
645 | 368 | { | ||
646 | 369 | return false; | ||
647 | 370 | } | ||
648 | 371 | |||
649 | 372 | if (query && book.title.indexOf(query) === -1 && book.author.indexOf(query) === -1) | ||
650 | 373 | { | ||
651 | 374 | return false; | ||
652 | 375 | } | ||
653 | 376 | |||
654 | 377 | return true; | ||
655 | 378 | } | ||
656 | 379 | |||
657 | 380 | function generate_results(canned_query, reply, book_format, book_categories, min_price, max_price, rating) | ||
658 | 381 | { | ||
659 | 382 | var query_string = canned_query.query_string(); | ||
660 | 383 | var dept_id = canned_query.department_id(); | ||
661 | 384 | |||
662 | 385 | var show_single_cat = (dept_id); | ||
663 | 386 | |||
664 | 387 | rating = Math.round(rating); | ||
665 | 388 | |||
666 | 389 | var count = 0; | ||
667 | 390 | if (show_single_cat) { | ||
668 | 391 | for (var i = 0; i < books.length; i++) | ||
669 | 392 | { | ||
670 | 393 | if (match(books[i], query_string, dept_id, book_format, book_categories, min_price, max_price, rating)) { | ||
671 | 394 | ++count; | ||
672 | 395 | } | ||
673 | 396 | } | ||
674 | 397 | } | ||
675 | 398 | |||
676 | 399 | var category_renderer = new scopes.lib.CategoryRenderer(JSON.stringify(CATEGORY_TEMPLATE)); | ||
677 | 400 | var cat_single = reply.register_category("all", count + " Books", "", category_renderer); | ||
678 | 401 | var cat_fiction = reply.register_category("fiction", "Fiction", "", category_renderer); | ||
679 | 402 | var cat_children = reply.register_category("childrens", "Children", "", category_renderer); | ||
680 | 403 | |||
681 | 404 | for (var i = 0; i < books.length; i++) | ||
682 | 405 | { | ||
683 | 406 | book = books[i]; | ||
684 | 407 | if (match(book, query_string, dept_id, book_format, book_categories, min_price, max_price, rating)) { | ||
685 | 408 | var cat; | ||
686 | 409 | if (show_single_cat) { | ||
687 | 410 | cat = cat_single; | ||
688 | 411 | } else { | ||
689 | 412 | if (book.department == "fiction") { | ||
690 | 413 | cat = cat_fiction; | ||
691 | 414 | } else { | ||
692 | 415 | cat = cat_children; | ||
693 | 416 | } | ||
694 | 417 | } | ||
695 | 418 | var res = new scopes.lib.CategorisedResult(cat); | ||
696 | 419 | res.set_uri("uri" + count++); | ||
697 | 420 | res.set_title(book.title); | ||
698 | 421 | res.set_art(scopes.self.scope_directory + "/covers/" + book.department + "/" + book.art); | ||
699 | 422 | res.set("subtitle", book.author); | ||
700 | 423 | res.set("description", book.synopsis); | ||
701 | 424 | |||
702 | 425 | var rating_s = "☆ " + book.rating; | ||
703 | 426 | var price_s = "£" + book.price; | ||
704 | 427 | |||
705 | 428 | res.set("price", price_s); | ||
706 | 429 | res.set("rating", rating_s); | ||
707 | 430 | |||
708 | 431 | res.set("attributes", [{value: price_s}, {value: rating_s}]); | ||
709 | 432 | |||
710 | 433 | // Push the result | ||
711 | 434 | if (!reply.push(res)) { | ||
712 | 435 | return; | ||
713 | 436 | } | ||
714 | 437 | } | ||
715 | 438 | } | ||
716 | 439 | } | ||
717 | 440 | |||
718 | 441 | scopes.self.initialize( | ||
719 | 442 | {} | ||
720 | 443 | , | ||
721 | 444 | { | ||
722 | 445 | run: function() { | ||
723 | 446 | console.log('Running...') | ||
724 | 447 | }, | ||
725 | 448 | start: function(scope_id) { | ||
726 | 449 | console.log('Starting scope id: ' | ||
727 | 450 | + scope_id | ||
728 | 451 | + ', ' | ||
729 | 452 | + scopes.self.scope_directory) | ||
730 | 453 | }, | ||
731 | 454 | search: function(canned_query, metadata) { | ||
732 | 455 | return new scopes.lib.SearchQuery( | ||
733 | 456 | canned_query, | ||
734 | 457 | metadata, | ||
735 | 458 | // run | ||
736 | 459 | function(search_reply) { | ||
737 | 460 | var query_string = canned_query.query_string(); | ||
738 | 461 | var dept_id = canned_query.department_id(); | ||
739 | 462 | var filter_state = canned_query.filter_state(); | ||
740 | 463 | |||
741 | 464 | // departments | ||
742 | 465 | var root = new scopes.lib.Department("", canned_query, "All Books"); | ||
743 | 466 | root.add_subdepartment(new scopes.lib.Department("fiction", canned_query, "Fiction")); | ||
744 | 467 | root.add_subdepartment(new scopes.lib.Department("childrens", canned_query, "Children's")); | ||
745 | 468 | search_reply.register_departments(root); | ||
746 | 469 | |||
747 | 470 | var group = new scopes.lib.FilterGroup("group1", "Params"); | ||
748 | 471 | var price_filter = new scopes.lib.RangeInputFilter("price", "Min", "", "to", "Max", "", group); | ||
749 | 472 | price_filter.set_title("Price range"); | ||
750 | 473 | |||
751 | 474 | var rating_filter_labels = new scopes.lib.ValueSliderLabels("1", "5", [[2, "2"], [3, "3"], [4, "4"]]); | ||
752 | 475 | var rating_filter = new scopes.lib.ValueSliderFilter("rating", 1, 5, 1, rating_filter_labels, group); | ||
753 | 476 | rating_filter.set_title("Rating"); | ||
754 | 477 | |||
755 | 478 | var category_filter = new scopes.lib.OptionSelectorFilter("bookcategory", "Top picks", true); | ||
756 | 479 | category_filter.add_option("book of the month", "Book of the month"); | ||
757 | 480 | category_filter.add_option("bestseller", "Bestsellers"); | ||
758 | 481 | category_filter.add_option("special edition", "Special editions"); | ||
759 | 482 | category_filter.add_option("recommended", "Recommended"); | ||
760 | 483 | |||
761 | 484 | var format_filter = new scopes.lib.OptionSelectorFilter("format", "Format", false); | ||
762 | 485 | format_filter.add_option("hardback", "Hardcover"); | ||
763 | 486 | format_filter.add_option("paperback", "Paperback"); | ||
764 | 487 | format_filter.add_option("audiobook", "Audiobook"); | ||
765 | 488 | |||
766 | 489 | var book_format = ""; | ||
767 | 490 | var book_categories = []; | ||
768 | 491 | var min_price = 0; | ||
769 | 492 | var max_price = 9999; | ||
770 | 493 | var rating = 0; | ||
771 | 494 | |||
772 | 495 | search_reply.push([category_filter, format_filter, price_filter, rating_filter], filter_state); | ||
773 | 496 | |||
774 | 497 | // determine filter values | ||
775 | 498 | var format = format_filter.active_options(filter_state); | ||
776 | 499 | if (format.length) | ||
777 | 500 | { | ||
778 | 501 | book_format = format[0].id(); | ||
779 | 502 | } | ||
780 | 503 | |||
781 | 504 | if (price_filter.has_start_value(filter_state)) | ||
782 | 505 | { | ||
783 | 506 | min_price = price_filter.start_value(filter_state); | ||
784 | 507 | } | ||
785 | 508 | |||
786 | 509 | if (price_filter.has_end_value(filter_state)) | ||
787 | 510 | { | ||
788 | 511 | max_price = price_filter.end_value(filter_state); | ||
789 | 512 | } | ||
790 | 513 | |||
791 | 514 | if (rating_filter.has_value(filter_state)) | ||
792 | 515 | { | ||
793 | 516 | rating = rating_filter.value(filter_state); | ||
794 | 517 | } | ||
795 | 518 | |||
796 | 519 | if (category_filter.has_active_option(filter_state)) | ||
797 | 520 | { | ||
798 | 521 | var cats = category_filter.active_options(filter_state); | ||
799 | 522 | for (var i = 0; i < cats.length; i++) | ||
800 | 523 | { | ||
801 | 524 | book_categories.push(cats[i].id()); | ||
802 | 525 | } | ||
803 | 526 | } | ||
804 | 527 | |||
805 | 528 | generate_results(canned_query, search_reply, book_format, book_categories, min_price, max_price, rating); | ||
806 | 529 | |||
807 | 530 | search_reply.finished(); | ||
808 | 531 | }, | ||
809 | 532 | // cancelled | ||
810 | 533 | function() { | ||
811 | 534 | }); | ||
812 | 535 | }, | ||
813 | 536 | preview: function(result, action_metadata) { | ||
814 | 537 | return new scopes.lib.PreviewQuery( | ||
815 | 538 | result, | ||
816 | 539 | action_metadata, | ||
817 | 540 | // run | ||
818 | 541 | function(preview_reply) { | ||
819 | 542 | var layout1col = new scopes.lib.ColumnLayout(1); | ||
820 | 543 | var layout2col = new scopes.lib.ColumnLayout(2); | ||
821 | 544 | var layout3col = new scopes.lib.ColumnLayout(3); | ||
822 | 545 | |||
823 | 546 | layout1col.add_column(["image", "header", "summary", "buttons"]); | ||
824 | 547 | |||
825 | 548 | layout2col.add_column(["image"]); | ||
826 | 549 | layout2col.add_column(["header", "summary", "buttons"]); | ||
827 | 550 | |||
828 | 551 | layout3col.add_column(["image"]); | ||
829 | 552 | layout3col.add_column(["header", "summary", "buttons"]); | ||
830 | 553 | layout3col.add_column([]); | ||
831 | 554 | |||
832 | 555 | preview_reply.register_layout([layout1col, layout2col, layout3col]); | ||
833 | 556 | |||
834 | 557 | var header = new scopes.lib.PreviewWidget("header", "header"); | ||
835 | 558 | header.add_attribute_value( | ||
836 | 559 | "attributes", | ||
837 | 560 | [ | ||
838 | 561 | { | ||
839 | 562 | "value": result.get("price") | ||
840 | 563 | }, | ||
841 | 564 | { | ||
842 | 565 | "value": result.get("rating") | ||
843 | 566 | } | ||
844 | 567 | ] | ||
845 | 568 | ); | ||
846 | 569 | header.add_attribute_mapping("title", "title"); | ||
847 | 570 | header.add_attribute_mapping("subtitle", "subtitle"); | ||
848 | 571 | |||
849 | 572 | var image = new scopes.lib.PreviewWidget("image", "image"); | ||
850 | 573 | image.add_attribute_mapping("source", "art"); | ||
851 | 574 | |||
852 | 575 | var description = new scopes.lib.PreviewWidget("summary", "text"); | ||
853 | 576 | description.add_attribute_mapping("text", "description"); | ||
854 | 577 | |||
855 | 578 | var buttons = new scopes.lib.PreviewWidget("buttons", "actions"); | ||
856 | 579 | buttons.add_attribute_value( | ||
857 | 580 | "actions", | ||
858 | 581 | [ | ||
859 | 582 | { | ||
860 | 583 | "id": "close", | ||
861 | 584 | "label": "Close" | ||
862 | 585 | } | ||
863 | 586 | ] | ||
864 | 587 | ); | ||
865 | 588 | |||
866 | 589 | preview_reply.push([image, header, description, buttons ]); | ||
867 | 590 | preview_reply.finished(); | ||
868 | 591 | |||
869 | 592 | }, | ||
870 | 593 | // cancelled | ||
871 | 594 | function() { | ||
872 | 595 | }); | ||
873 | 596 | }, | ||
874 | 597 | perform_action: function(result, metadata, widget_id, action_id) { | ||
875 | 598 | return new scopes.lib.ActivationQuery( | ||
876 | 599 | result, | ||
877 | 600 | metadata, | ||
878 | 601 | widget_id, | ||
879 | 602 | action_id, | ||
880 | 603 | // activate | ||
881 | 604 | function() { | ||
882 | 605 | var activation_response; | ||
883 | 606 | |||
884 | 607 | switch (action_id) | ||
885 | 608 | { | ||
886 | 609 | case 'close': | ||
887 | 610 | activation_response = new scopes.lib.ActivationResponse( | ||
888 | 611 | scopes.defs.ActivationResponseStatus.ShowDash); | ||
889 | 612 | break; | ||
890 | 613 | default: | ||
891 | 614 | activation_response = new scopes.lib.ActivationResponse( | ||
892 | 615 | scopes.defs.ActivationResponseStatus.NotHandled); | ||
893 | 616 | break; | ||
894 | 617 | } | ||
895 | 618 | |||
896 | 619 | return activation_response; | ||
897 | 620 | }, | ||
898 | 621 | // cancelled | ||
899 | 622 | function() { | ||
900 | 623 | }); | ||
901 | 624 | } | ||
902 | 625 | } | ||
903 | 626 | ); | ||
904 | 627 |
FAILED: Continuous integration, rev:143 /jenkins. canonical. com/unity- api-1/job/ lp-unity- js-scopes- ci/7/ /jenkins. canonical. com/unity- api-1/job/ build/67/ console /jenkins. canonical. com/unity- api-1/job/ build-0- fetch/74/ console
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/unity- api-1/job/ lp-unity- js-scopes- ci/7/rebuild
https:/