3 <meta name="viewport" content="width=device-width">
6 <h1>Tizen Content API</h1>
8 <button onClick="handleCleanConsole()">Clean</button>
9 <button onClick="handleGetDirectories()">Get Directories</button>
10 <button onClick="handleFind()">Find</button>
11 <button onClick="handleScanFile()">Scan File</button>
14 <h2>Attribute Filter</h2>
15 <select id="attribute-name">
16 <option value="type">type</option>
17 <option value="mimeType">mime</option>
18 <option value="title">title</option>
19 <option value="contentURI">uri</option>
20 <option value="thumbnailURIs">thumbnails</option>
21 <option value="size">size</option>
22 <option value="rating">rating</option>
23 <option value="artists">artist</option>
24 <option value="duration">duration</option>
25 <option value="width">width</option>
26 <option value="height">height</option>
28 <select id="match-flag">
29 <option value="EXACTLY">EXACTLY</option>
30 <option value="FULLSTRING">FULLSTRING</option>
31 <option value="CONTAINS">CONTAINS</option>
32 <option value="STARTSWITH">STARTSWITH</option>
33 <option value="ENDSWITH">ENDSWITH</option>
34 <option value="EXISTS">EXISTS</option>
36 <input id="match-value" type="text">
40 <pre id="console"></pre>
41 <script src="js/js-test-pre.js"></script>
44 function handleCleanConsole()
46 var el = document.getElementById("console");
48 el.removeChild(el.firstChild);
51 function handleGetDirectories()
54 debug('tizen.content.getDirectories:');
55 tizen.content.getDirectories(function(folders) {
56 for (var i = 0; i < folders.length; i++) {
57 debug(folders[i].title + ', ' + folders[i].directoryURI);
72 var e = document.getElementById("attribute-name");
73 var attributeName = e.options[e.selectedIndex].value;
74 e = document.getElementById("match-flag");
75 var matchFlag = e.options[e.selectedIndex].value;
76 var matchValue = document.getElementById('match-value').value;
78 debug("Filter: " + attributeName + ' ' + matchFlag + ' ' + matchValue);
79 if (matchValue != "" || matchFlag == "EXISTS")
80 filter = new tizen.AttributeFilter(attributeName, matchFlag, matchValue);
83 debug('tizen.content.find:');
84 tizen.content.find(function(items) {
85 for (var i = 0; i < items.length; i++) {
86 debug(items[i].title + ', ' + items[i].mimeType);
97 function handleScanFile()
100 debug('tizen.content.scanFile:');
101 tizen.content.scanFile("file:///opt/usr/media/Images/Default.jpg",
103 debug("scan OK: " + uri);