--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>MediaContent</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>json.validation.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.tizen.web.jslint.nature.JSLintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.tizen.web.editor.css.nature.CSSBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.tizen.web.project.builder.WebBuilder</name>
+ <arguments>
+ <dictionary>
+ <key>usedLibraryType</key>
+ <value>WebUIFramework</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>json.validation.nature</nature>
+ <nature>org.tizen.web.jslint.nature.JSLintNature</nature>
+ <nature>org.tizen.web.editor.css.nature.CSSNature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ <nature>org.tizen.web.project.builder.WebNature</nature>
+ </natures>
+</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/Mediacontent" version="0.1.4" viewmodes="maximized">
- <content src="index.html"/>
- <tizen:privilege name="http://tizen.org/privilege/content.read" />
- <tizen:privilege name="http://tizen.org/privilege/content.write" />
- <icon src="icon.png"/>
- <tizen:application id="samplemedi.Mediacontent" package="samplemedi" required_version="2.1"/>
- <tizen:setting screen-orientation="portrait" context-menu="disable" background-support="enable" encryption="disable" install-location="auto"/>
- <name>Mediacontent</name>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/MediaContent" version="0.1.4" viewmodes="maximized">
+ <tizen:application id="JCOEaC8EKB.MediaContent" package="JCOEaC8EKB" required_version="2.2"/>
+ <content src="index.html"/>
+ <icon src="icon.png"/>
+ <name>MediaContent</name>
+ <tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>
+ <tizen:privilege name="http://tizen.org/privilege/content.read"/>
+ <tizen:privilege name="http://tizen.org/privilege/content.write"/>
+ <tizen:setting screen-orientation="portrait" context-menu="disable" background-support="enable" encryption="disable" install-location="auto"/>
</widget>
<meta name="description" content="Mediacontent API Tutorial"/>
<title>Mediacontent</title>
- <script src="tizen-web-ui-fw/latest/js/jquery.min.js"></script>
- <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
- <script src="tizen-web-ui-fw/latest/js/tizen-web-ui-fw.min.js" data-framework-viewport-scale="false"></script>
+ <script src="/usr/share/tizen-web-ui-fw/latest/js/jquery.min.js"></script>
+ <script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
+ <script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.min.js" data-framework-viewport-scale="false"></script>
<script type="text/javascript" src="./js/main.js"></script>
<link rel="stylesheet" type="text/css" href="./css/style.css"/>
</head>
<body>
- <div data-role="page" data-add-back-btn="true" id="main">
+ <div data-role="page" data-add-back-btn="header" id="main">
<div data-role="header" data-position="fixed">
- <h1>MEDIA CONTENT</h1>
+ <h1>Media content</h1>
</div>
<div data-role="content">
<li data-role="list-divider" id="folder-text">Folders</li>
</ul>
</div>
-
- <div data-role="footer" data-position="fixed">
- </div>
</div>
- <div data-role="page" data-add-back-btn="true" id="items">
+ <div data-role="page" data-add-back-btn="header" id="items">
<div data-role="header" data-position="fixed">
<h1 id="items-title"></h1>
</div>
<li data-role="list-divider">Items</li>
</ul>
</div>
-
- <div data-role="footer" data-position="fixed">
- </div>
</div>
- <div data-role="page" data-add-back-btn="true" id="detail">
+ <div data-role="page" data-add-back-btn="header" id="detail">
<div data-role="header" data-position="fixed">
- <h1>DETAILS</h1>
+ <h1>Details</h1>
</div>
<div data-role="content">
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2012 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://floralicense.org/license
+ * http://floralicense.org/license
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
var gMediaSource, gMediaFolders, gMediaItems, gItemId, gFolderId, gMediaType = "ALL";
-var flagInit;
+var gStorageType, flagInit;
$(document).delegate("#main", "pageinit", function() {
flagInit = false;
+ gStorageType = gMediaType;
+
$("#main .ui-btn-back").bind("vclick", function() {
tizen.application.getCurrentApplication().exit();
return false;
$("#folder-type-internal").css('color','black');
$("#folder-type-external").css('color','red');
});
-});
+ onContentChange();
+});
$(document).delegate("#items", "pageinit", function() {
$("#items").bind("pagebeforeshow", showItemList);
$("#detail").bind("pagebeforeshow", showMediaDetail);
});
+document.addEventListener('tizenhwkey', function(e) {
+ if (e.keyName == "back") {
+ if ($.mobile.activePage.attr('id') === 'main') {
+ tizen.application.getCurrentApplication().exit();
+ } else {
+ history.back();
+ }
+ }
+});
+
+function setLastStorage(storageType) {
+ gStorageType = storageType;
+}
+
function makeListItem(id, mainText, subText) {
return '<li class="ui-li-has-multiline ui-li-text-ellipsis"'
+ (id == null ? '' : ' data-id="'+ id +'"')
flagInit = true;
}
+function onContentChange() {
+ /* blocked by TDIS-6374
+ var listener= {
+ oncontentadded: function(content) {
+ getFolders(gStorageType);
+ },
+ oncontentupdated: function(content) {
+ getFolders(gStorageType);
+ },
+ oncontentremoved: function(id) {
+ getFolders(gStorageType);
+ }
+ };
+
+ tizen.content.setChangeListener(listener);
+ */
+ tizen.filesystem.addStorageStateChangeListener(function (e) {
+ // workaround, blocked by TDIS-6374
+ setTimeout(function () {
+ getFolders(gStorageType);
+ }, 1000)
+ });
+}
+
function showFolderList(storageType) {
+ setLastStorage(storageType);
if(flagInit == false){
getFolders(storageType);
var str = '';
for (var i = 0; i < gMediaFolders.length; i++) {
if (storageType == "ALL" || storageType == gMediaFolders[i].storageType) {
- str += makeListItem(i, gMediaFolders[i].title, gMediaFolders[i].folderURI);
+ str += makeListItem(i, gMediaFolders[i].title, gMediaFolders[i].directoryURI);
}
}
$("#folder-list>li[data-id]").remove();