5 //width: 480; height: 360;
6 width: parent.width; height: parent.height;
7 //property string feedid: "61ac1458d761423344998dc76770e36e" //articlesItem.feedid;
8 //property string hideReadArticles: "";
9 property alias articleShown: articleView.visible;
10 property bool zoomEnabled: false;
11 property bool vertPanningEnabled: true
13 function modulo(x,y) {
14 // Fixes modulo for negative numbers
23 if (articleView.visible) {
24 //articleView.positionViewAtIndex(modulo(articleView.currentIndex+1, articleView.count), ListView.Contain);
25 articleView.incrementCurrentIndex();
30 if (articleView.visible) {
31 //articleView.positionViewAtIndex(modulo(articleView.currentIndex-1, articleView.count), ListView.Contain);
32 articleView.decrementCurrentIndex();
37 id: articleList; model: visualModel.parts.list; z: 6
38 width: parent.width; height: parent.height; /*x: 0;*/
40 flickDeceleration: 1500
44 id: articleView; model: visualModel.parts.flip; orientation: ListView.Horizontal
45 width: parent.width; height: parent.height; visible: false; z:8
46 //onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
47 highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
49 onMovementStarted: articleViewer.vertPanningEnabled=false;
50 onMovementEnded: articleViewer.vertPanningEnabled=true;
51 highlightMoveDuration: 300;
58 Item { id: flipItem; Package.name: 'flip'; width: articleViewer.width; height: articleViewer.height;
60 property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? "http://localhost:8000/html/" + articleViewer.feedid + "/" + articleid : "";
62 zoomEnabled: articleViewer.zoomEnabled;
63 property bool vertPanningEnabled: articleViewer.vertPanningEnabled;
66 name: 'articleIsRead';
67 when: articleView.visible && articleView.currentIndex == index;
71 flipItem.url="http://localhost:8000/html/" + articleViewer.feedid + "/" + articleid;
72 var doc = new XMLHttpRequest();
73 var url = "http://localhost:8000/read/" + articleViewer.feedid + "/" + articleid;
77 //var xmlDoc=doc.responseXML;
81 name: 'articleIsClose'; when: articleView.visible && Math.abs(articleView.currentIndex-index)<2;
83 script: { flipItem.url="http://localhost:8000/html/" + articleViewer.feedid + "/" + articleid;}
90 Item { Package.name: 'list';
91 id: wrapper; width: articleViewer.width; height: 86
94 Rectangle { id: backRect; color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 }
96 anchors.fill: backRect
98 verticalAlignment: Text.AlignVCenter; text: title; color: (unread=="True") ? "white" : "#7b97fd";
99 width: wrapper.width; wrapMode: Text.WordWrap; font.bold: false;
102 MouseArea { anchors.fill: wrapper;
103 onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; }
113 source: articleViewer.feedid == "" ? "" : "http://localhost:8000/articles/" + feedid + "?onlyUnread=" + hideReadArticles
114 query: "/xml/article"
116 XmlRole { name: "title"; query: "title/string()" }
117 XmlRole { name: "articleid"; query: "articleid/string()"; isKey: true }
118 XmlRole { name: "path"; query: "path/string()" }
119 XmlRole { name: "unread"; query: "unread/string()"; isKey: true}