Skip to content

Commit

Permalink
Article source added to each exericse card
Browse files Browse the repository at this point in the history
box-shadow
  • Loading branch information
martinavagyan committed Aug 18, 2017
1 parent e3f1c60 commit 844dd71
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
11 changes: 11 additions & 0 deletions src/zeeguu_exercises/static/js/app/exercises/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Exercise.prototype = {
this.$deleteBtn = this.$elem.find('#btn-delete');
this.$reportBtn = this.$elem.find('#btn-report');
this.$speakBtn = this.$elem.find('#btn-speak');
this.$sourceBtn = this.$elem.find('#btn-source');
this.cacheCustomDom();
},

Expand Down Expand Up @@ -209,6 +210,14 @@ Exercise.prototype = {
this.onRenderNextEx();
},

/**
* Function to open the source in a new tab
* */
giveSource: function (idx) {
let url = this.data[idx].url;
let win = window.open(url, '_blank');
win.focus();
},

/**
* Removes focus of page elements
Expand Down Expand Up @@ -268,6 +277,7 @@ Exercise.prototype = {
//Bind general actions
this.$deleteBtn.click(() => {this.deleteBookmark(this.index);});
this.$reportBtn.click(() => {this.giveFeedbackBox(this.index);});
this.$sourceBtn.click(() => {this.giveSource(this.index);});
this.$speakBtn.click(() => {this.handleSpeak();});

//Bind custom actions for each exercise
Expand All @@ -281,6 +291,7 @@ Exercise.prototype = {
this.$deleteBtn.off( "click");
this.$reportBtn.off( "click");
this.$speakBtn.off( "click");
this.$sourceBtn.off( "click");
//TODO terminate individual bindings for each exercise,
//TODO for that implement terminate method for each
},
Expand Down
2 changes: 1 addition & 1 deletion src/zeeguu_exercises/static/js/app/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
ZEEGUU_API: 'https://zeeguu.unibe.ch/api',
ZEEGUU_SESSION_ID: 'sessionID',
ZEEGUU_DEFAULT_COOKIE_EXPIRATION: 21, //days
ZEEGUU_DEFAULT_SESSION: '00055320',// 00055320-french 00026435 00926044 34563456 11010001
ZEEGUU_DEFAULT_SESSION: '00926044',// 00055320-french 00026435 00926044 34563456 11010001

/******************** Exercise Bookmark Parameters ************************/
ZEEGUU_STUDY_BOOKMARKS: '/bookmarks_to_study/',
Expand Down
6 changes: 6 additions & 0 deletions src/zeeguu_exercises/static/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -800,3 +800,9 @@ body
:-moz-placeholder { /* Firefox 18- */
color: #c8cccf;
}

/** Bookmark source*/
.bookmark-source{
color: grey;
float:right;
}
5 changes: 3 additions & 2 deletions src/zeeguu_exercises/static/styles/dropdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
margin-left:-100px;
position:absolute;
min-width:110px !important;
box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
box-shadow: 0 8px 10px 1px rgba(0,0,0,0.14),
0 3px 14px 2px rgba(0,0,0,0.12),
0 5px 5px -3px rgba(0,0,0,0.2);
}
.dropdown-menu>li>a {
color:#616161;
cursor: pointer;
}
.dropdown ul.dropdown-menu {
border-radius:4px;
box-shadow:none;
margin-top:12px;
}
.dropdown ul.dropdown-menu:before {
Expand Down
4 changes: 2 additions & 2 deletions src/zeeguu_exercises/static/template/exercise/exercise.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
</div>
</div>
<div class="col-xs-2">

<div class = "btn-group dropdown right-float">
<div class="round-icon-container dropdown-toggle" type="button" data-toggle="dropdown">
<div class="btn-more"></div>
Expand All @@ -30,9 +29,10 @@
<li><a id = "btn-delete"><span class="glyphicon glyphicon-trash pull-right"></span>Delete</a></li>
<li class="divider"></li>
<li><a id = "btn-report"><span class="glyphicon glyphicon-send pull-right"></span>Report</a></li>
<li class="divider"></li>
<li><a id = "btn-source"><span class="glyphicon glyphicon-map-marker pull-right"></span>Source</a></li>
</ul>
</div>

</div>
</div>
<div id = "custom-content"></div>
Expand Down

0 comments on commit 844dd71

Please sign in to comment.