redcross for disabled images working

parent ebae9049
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Pictogrammar" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -18,7 +18,7 @@ package com.yottacode.pictogrammar;
import java.util.LinkedList;
import java.util.Vector;
import org.grammaticalframework.PGF;
//import org.grammaticalframework.PGF;
import org.json.JSONException;
import org.json.JSONObject;
......@@ -112,7 +112,7 @@ public class Translate extends Activity implements iVocabularyListener, iImgDown
tts = new TTSHelper(this,"IVONA Text-to-Speech HQ");
tts = new TTSHelper(this);
new LoadPGFTask().execute();
//new LoadPGFTask().execute();
mArrayAdapter = new ArrayAdapter(this, R.layout.listitem);
......@@ -216,7 +216,7 @@ public class Translate extends Activity implements iVocabularyListener, iImgDown
/**
* This class is used to load the PGF file asychronously.
* It display a blocking progress dialog while doing so.
*/
*//*
private class LoadPGFTask extends AsyncTask<Void, Void, PGF> {
private ProgressDialog progress;
......@@ -244,7 +244,7 @@ public class Translate extends Activity implements iVocabularyListener, iImgDown
this.progress.dismiss(); // Remove loading popup
}
}
*/
/**
* This class is used to parse a sentence asychronously.
* It display a blocking progress dialog while doing so.
......
......@@ -424,15 +424,22 @@ textarea.editable{
/* Class for pictos when are deactivated to the student, but are visibles */
.picto img.deactivate {
/*.picto img.deactivate {
filter: url('#grayscale'); /* Versión SVG para IE10, Chrome 17, FF3.5, Safari 5.2 and Opera 11.6 */
filter: url('#grayscale'); / Versión SVG para IE10, Chrome 17, FF3.5, Safari 5.2 and Opera 11.6 /
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%); /* Para cuando es estándar funcione en todos */
filter: Gray(); /* IE4-8 and 9 */
filter: grayscale(100%); / Para cuando es estándar funcione en todos /
filter: Gray(); / IE4-8 and 9 /
}*/
.picto img.disabled {
position: absolute;
bottom: 0px; /* position will be on bottom */
left: 0px;
width: 100%;
}
/* Class for pictos that aren't saw by the student */
......
......@@ -40,6 +40,7 @@
"click": "Click",
"click_login": "Click to login",
"collections": "Collections",
"confirmation": "Are you sure?",
"contact_person": "Contact person",
"contact_person": "Contact person",
"continue_session": "Resume_session",
......
......@@ -40,6 +40,7 @@
"click": "Clic",
"click_login": "Clic para iniciar sesión",
"collections": "Colecciones",
"confirmation": "¿Estás seguro?",
"contact_person": "Persona de contacto",
"contact_person": "Persona de contacto",
"continue_session": "Reanudar sesión",
......
......@@ -12,7 +12,6 @@ String.prototype.hashCode = function() {
return hash;
};
// Creamos el módulo dashboardControllers, de donde colgarán todos los controladores
var dashboardControllers = angular.module('dashboardControllers', ['dashboardConfig']);
......
......@@ -43,6 +43,26 @@ dashboardDirectives.directive('footerTranslate', function(){
/*-------------------------------------------------------------------------------
*
* Confirmation pop up
*
*/
dashboardDirectives.directive('ngConfirmClick', [
function(){
return {
link: function (scope, element, attr) {
var msg = attr.ngConfirmClick || 'Are you sure?';
var clickAction = attr.confirmedClick;
element.bind('click', function (event) {
if ( window.confirm(msg) ) {
scope.$eval(clickAction);
}
});
}
};
}])
/*-------------------------------------------------------------------------------
*
* Mouse event related directives
*
*/
......
......@@ -3,7 +3,7 @@
//------------------
// Login Controller
//------------------
dashboardControllers.controller('LoginCtrl', function LoginCtrl($scope, $http, $window, $translate, $location, config, $stateParams) {
dashboardControllers.controller('LoginCtrl', function LoginCtrl($scope, $http, $window, $translate, $filter, $location, config, $stateParams) {
// The last parameter, config, is injected from config.js (defined in dashboardConfig module)
$scope.credentials = {
......@@ -12,6 +12,16 @@ dashboardControllers.controller('LoginCtrl', function LoginCtrl($scope, $http, $
lang: 'es-es'
};
// Pop-up blocker check
// var popup = window.open('http://yottacode.com','','',true);
// setTimeout( function() {
// if(!popup || popup.outerHeight === 0) {
// alert("cáspita");
// } else {
// popup && popup.close();
// }
// }, 100);
// Array of key terms to translate
$translate(['login_success', 'login_fail']).then(function (translations) {
//notification_email = translations.email_match;
......
......@@ -217,33 +217,29 @@ dashboardControllers.controller('StudentInstructionsCtrl', function StudentInstr
// Delete instruction of a method
$scope.delete_instruction = function(ins){
var deleteIns = $window.confirm('Are you absolutely sure you want to delete?');
if(deleteIns){
$http
.delete(config.backend+'/instruction/' + ins.id)
.success(function(data, status, headers, config) {
console.log('Deleted instruction:' + JSON.stringify(data));
// Buscar method
for(var i=0; i<$scope.methods.length; i++) {
var m = $scope.methods[i];
if(ins.method == m.id){
// Buscar la instrucción y eliminar de la vista
for(var j=0; j<m.instructions.length; j++) {
if(ins.id == m.instructions[j].id){
$scope.methods[i].instructions.splice(j,1);
break;
}
$http
.delete(config.backend+'/instruction/' + ins.id)
.success(function(data, status, headers, config) {
console.log('Deleted instruction:' + JSON.stringify(data));
// Buscar method
for(var i=0; i<$scope.methods.length; i++) {
var m = $scope.methods[i];
if(ins.method == m.id){
// Buscar la instrucción y eliminar de la vista
for(var j=0; j<m.instructions.length; j++) {
if(ins.id == m.instructions[j].id){
$scope.methods[i].instructions.splice(j,1);
break;
}
break;
}
}
}
break;
}
}
})
.error(function(data, status, headers, config) {
console.log("Error from API: " + data.error);
});
}
})
.error(function(data, status, headers, config) {
console.log("Error from API: " + data.error);
});
};
// Modal window to open instruction details
......
......@@ -46,6 +46,7 @@
<div ng-repeat="row in pcb_cat" class="filaPictos">
<div class="picto pull-left" ng-repeat="col in row track by $index">
<img src='/app/img/redcross.png' alt='' class='disabled' ng-if="col.attributes.status == 'disabled'"/>
<img ng-src="{{col.picto.uri}}" class="unselectable" popover="{{col.expression.text}}" popover-trigger="mouseenter" ng-click="col.attributes.coord_x != 0 && show_category(col.picto.id, col.expression.text, col.attributes.color)" ng-class="{'novisible': col.attributes.status == 'invisible', 'deactivate': col.attributes.status == 'disabled'}" ng-style="{'background-color': col.attributes.color }"/>
<div class="picto_options" ng-if="col.picto.uri != '/app/img/empty.gif'">
<!--
......
......@@ -76,7 +76,7 @@
'glyphicon-minus': i.status == null
}" aria-hidden="true" popover="{{(i.status || 'nobegin') | translate}}" popover-trigger="mouseenter" ng-click="change_status(i)"></span>
</td>
<td><a ng-click="delete_instruction(i)" class="delete_instruction"><span class="text_medium delete color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span></a></td>
<td><a confirmed-click="delete_instruction(i);" ng-confirm-click="{{ 'confirmation' | translate}}" class="delete_instruction"><span class="text_medium delete color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span></a></td>
</tr>
</table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment