/**
   * @function setLabelsAndIds
   * @created_date : Jan 2, 2014
   * @description To set Labels and Id for buttons.
   * @parm(s) :
   * @return : void
   * @throws : <Mentioned if any exceptions>
   */
  private void setLabelsAndIds() {
    btnResourceLink.setText(i18n.GL0548());
    btnResourceLink.getElement().setId("btnResourceLink");
    btnResourceLink.getElement().setAttribute("alt", i18n.GL0548());
    btnResourceLink.getElement().setAttribute("title", i18n.GL0548());

    lblGooruFieldTrip.setText(i18n.GL0549());
    lblGooruFieldTrip.getElement().setId("lblGooruFieldTrip");
    lblGooruFieldTrip.getElement().setAttribute("alt", i18n.GL0549());
    lblGooruFieldTrip.getElement().setAttribute("title", i18n.GL0549());

    // lblGooruFieldTripDescUnforseen.setText(i18n.GL0550);
    // lblGooruFieldTripDescOriginal.setText(i18n.GL0552);
    lblGooruFieldTripDescOriginal.setText("");
    lblGooruFieldTripDescOriginal.getElement().setId("lblGooruFieldTripDescOriginal");
    lblGooruFieldTripDescOriginal.getElement().setAttribute("alt", "");
    lblGooruFieldTripDescOriginal.getElement().setAttribute("title", "");

    lblDontForget.setText(i18n.GL0551());
    lblDontForget.getElement().setId("lblDontForget");
    lblDontForget.getElement().setAttribute("alt", i18n.GL0551());
    lblDontForget.getElement().setAttribute("title", i18n.GL0551());

    imgFieldTrip.getElement().setId("imgFieldTrip");
    imgFieldTrip.setUrl("images/framebraker/field-trip.png");

    resoruceFrameBrakerContainer.getElement().setId("fpnlResoruceFrameBrakerContainer");
    resourceCategory.getElement().setId("pnlResourceCategory");
    lblGooruFieldTripDescUnforseen.getElement().setId("lblGooruFieldTripDescUnforseen");
    supportTip.getElement().setId("lblSupportTip");
    //		learnMoreLbl.setText("Learn more.");
  }
Пример #2
0
  public void showCollectionAddImageWidget() {
    getAddToShelfCollectionButton().setText(i18n.GL0590());
    successMessageLabelText.setText(i18n.GL0547());
    successMessageLabelText.getElement().setAttribute("alt", i18n.GL0547());
    successMessageLabelText.getElement().setAttribute("title", i18n.GL0547());
    addResourceInsteadLabelContainerInCollectionImage.clear();
    addResourceInsteadLabelContainerInCollectionImage.add(addResourceInsteadLabel);

    addResourceInsteadLabel.getElement().getStyle().clearMarginLeft();
    addResourceInsteadLabel.getElement().getStyle().clearMarginTop();
    collectionAddImageContainer.setVisible(true);
    collectionAddedSuccessMessageContainer.setVisible(false);
  }
 @Override
 public void resetQuestionView() {
   openEndedQuestionText.setHTML("");
   hintsButton.setText(i18n.GL0667());
   hintsButton.getElement().setAttribute("alt", i18n.GL0667());
   hintsButton.getElement().setAttribute("title", i18n.GL0667());
   hintsButton.setStyleName(oeStyle.hintsActiveButton());
   explanaionButton.setStyleName(oeStyle.hintsActiveButton());
   explanationContainer.removeStyleName(oeStyle.explanationTextBorder());
   hintsContainer.clear();
   explanationContainer.clear();
   clearAnswerOptionsContainer();
   openEndedQuestionImage.getElement().removeAttribute("src");
 }
 /** Average star ratings widget will get integrated. */
 private void setAvgRatingWidget() {
   ratingWidgetView = new RatingWidgetView();
   if (collectionItemDo.getResource().getRatings() != null) {
     if (collectionItemDo.getResource().getRatings().getCount() != null
         && collectionItemDo.getResource().getRatings().getCount() != 0) {
       ratingWidgetView.getRatingCountOpenBrace().setText(i18n.GL_SPL_OPEN_SMALL_BRACKET());
       ratingWidgetView
           .getRatingCountLabel()
           .setText(collectionItemDo.getResource().getRatings().getCount().toString());
       ratingWidgetView.getRatingCountCloseBrace().setText(i18n.GL_SPL_CLOSE_SMALL_BRACKET());
       ratingWidgetView.setAvgStarRating(collectionItemDo.getResource().getRatings().getAverage());
       ratingWidgetPanel.getElement().setId("fpnlRatingWidgetPanel");
     }
   }
   ratingWidgetPanel.clear();
   ratingWidgetPanel.add(ratingWidgetView);
 }
Пример #5
0
 protected void renderTeamNames(FlowPanel teamContainer2, List<String> teamMembersNames) {
   teamContainer2.clear();
   FlowPanel toolTipwidgets = new FlowPanel();
   for (int count = 0; count < teamMembersNames.size(); count++) {
     Label label = new Label(teamMembersNames.get(count));
     label.setStyleName(SearchResultWrapperCBundle.INSTANCE.css().moreMetaLbl());
     toolTipwidgets.add(label);
   }
   if (teamMembersNames != null && teamMembersNames.size() > 0) {
     //			Integer moreCount = teamMembersNames.size() - 1;
     DownToolTipWidgetUc toolTipUc =
         new DownToolTipWidgetUc(new Label(" " + i18n.GL1117()), toolTipwidgets);
     toolTipUc.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().teamHyperLink());
     teamContainer2.add(toolTipUc);
     toolTipUc.getTooltipPopUpUc(i18n.GL1117());
   }
 }
Пример #6
0
 /** Share the data by using FB. */
 private void onFbShareEvent() {
   MixpanelUtil.Click_On_FaceBook();
   if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.PROFILE_PAGE)) {
     if (socialDo.getIsSearchShare()) {
       triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false);
       SocialShareView.postOnFacebook(
           socialDo.getTitle(), socialDo.getRawUrl(), description, categoryImage.getUrl());
       //				Window.open(
       //						"http://www.facebook.com/sharer/sharer.php?s=100&p[url]="
       //								+ socialDo.getRawUrl() + "&p[images][0]="
       //								+ socialDo.getThumbnailurl() + "&p[title]="
       //								+ socialDo.getTitle().replaceAll("\\+", "%2B") + "&p[summary]=" + description,
       //								"_blank", "width=626,height=436");
     } else {
       triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false);
       String title = i18n.GL1995() + " " + i18n.GL1433();
       String token = Window.Location.getHref();
       SocialShareView.postOnFacebook(
           title,
           socialDo.getRawUrl(),
           getAsHtml(description) + " " + token,
           categoryImage.getUrl());
       //				Window.open(
       //						"http://www.facebook.com/sharer/sharer.php?s=100&p[url]="
       //								+socialDo.getRawUrl() + "&p[images][0]="
       //								+ socialDo.getThumbnailurl() + "&p[title]="
       //								+ "Check out "+socialDo.getTitle().replaceAll("\\+", "%2B")+" on Gooru" +
       // "&p[summary]=" + description,
       //								"_blank", "width=626,height=436");
     }
   } else {
     triggerShareDataEvent(PlayerDataLogEvents.FACEBOOK, false);
     SocialShareView.postOnFacebook(
         socialDo.getTitle(), socialDo.getRawUrl(), description, categoryImage.getUrl());
     //			Window.open(
     //					"http://www.facebook.com/sharer/sharer.php?s=100&p[url]="
     //							+ socialDo.getRawUrl() + "&p[images][0]="
     //							+ socialDo.getThumbnailurl() + "&p[title]="
     //							+ socialDo.getTitle().replaceAll("\\+", "%2B") + "&p[summary]=" + description,
     //							"_blank", "width=626,height=436");
   }
 }
 @UiHandler("hintsButton")
 public void ClickOnHintButton(ClickEvent clickEvent) {
   if (hintsButton.getStyleName().equals(oeStyle.hintsActiveButton())) {
     if (collectionItemDo.getResource().getHints().size() > hintsLength) {
       startHintDataLogEvent(getQuestionHintsDo(hintsLength).getHintId());
       hintsContainer.add(
           getHTML(getQuestionHintsDo(hintsLength).getHintText(), oeStyle.hintsText()));
       hintsButton.setText(
           ""
               + i18n.GL0317()
               + " ("
               + ((collectionItemDo.getResource().getHints().size() - hintsLength) - 1)
               + " Left)");
       hintsButton
           .getElement()
           .setAttribute(
               "alt",
               " "
                   + i18n.GL0317()
                   + " ("
                   + collectionItemDo.getResource().getHints().size()
                   + " Left)");
       hintsButton
           .getElement()
           .setAttribute(
               "title",
               " "
                   + i18n.GL0317()
                   + " ("
                   + collectionItemDo.getResource().getHints().size()
                   + " Left)");
       hintsLength++;
       if (collectionItemDo.getResource().getHints().size() == hintsLength) {
         hintsButton.setStyleName(oeStyle.hintsInActiveButton());
       }
     } else {
       hintsButton.setStyleName(oeStyle.hintsInActiveButton());
     }
   }
 }
  @Inject
  public QuestionResourceView() {
    setWidget(uiBinder.createAndBindUi(this));
    questiontext.getElement().setInnerHTML(i18n.GL0308());
    questiontext.getElement().setId("pnlQuestiontext");
    questiontext.getElement().setAttribute("alt", i18n.GL0308());
    questiontext.getElement().setAttribute("title", i18n.GL0308());

    hintsButton.setText(i18n.GL0667());
    hintsButton.getElement().setId("btnHintsButton");
    hintsButton.getElement().setAttribute("alt", i18n.GL0667());
    hintsButton.getElement().setAttribute("title", i18n.GL0667());

    explanaionButton.setText(i18n.GL0316());
    explanaionButton.getElement().setId("btnexplanaionButton");
    explanaionButton.getElement().setAttribute("alt", i18n.GL0316());
    explanaionButton.getElement().setAttribute("title", i18n.GL0316());

    openEndedQuestionText.getElement().setId("htmlOpenEndedQuestionText");
    questionContainer.getElement().setId("fpnlQuestionContainer");
    openEndedQuestionImage.getElement().setId("imgOpenEndedQuestionImage");
    hintsContainer.getElement().setId("fpnlHintsContainer");
    explanationContainer.getElement().setId("pnlExplanationContainer");
  }
Пример #9
0
 public void showSuccessMessageWidget(String collectionId) {
   getAddingLabel().setVisible(false);
   getAddToShelfCollectionButton().setVisible(true);
   if (getAddToShelfCollectionButton().getText().equalsIgnoreCase("Add")) {
     getAddToShelfCollectionButton().setText(i18n.GL0691());
     successMessageLabelText.setText(i18n.GL0547());
     successMessageLabelText.getElement().setAttribute("alt", i18n.GL0547());
     successMessageLabelText.getElement().setAttribute("title", i18n.GL0547());
   } else {
     successMessageLabelText.setText(i18n.GL0692());
     successMessageLabelText.getElement().setAttribute("alt", i18n.GL0692());
     successMessageLabelText.getElement().setAttribute("title", i18n.GL0692());
   }
   addCollectionInsteadLabelContainer.clear();
   addResourceInsteadLabel.setText(i18n.GL0685());
   addCollectionInsteadLabelContainer.add(addResourceInsteadLabel);
   addResourceInsteadLabel.getElement().getStyle().setMarginRight(60, Unit.PX);
   // addResourceInsteadLabel.getElement().getStyle().setMarginTop(-15,Unit.PX);
   collectionAddImageContainer.setVisible(false);
   collectionAddedSuccessMessageContainer.setVisible(true);
   workSpaceLink.setHref("#organize&id=" + collectionId + "&eventType=refresh");
 }
Пример #10
0
 /** Share the data by using Twister. */
 private void onTwisterShareEvent() {
   MixpanelUtil.Click_On_Twitter();
   if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.PROFILE_PAGE)) {
     if (socialDo.getIsSearchShare()) {
       triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false);
       Window.open(
           "http://twitter.com/intent/tweet?text="
               + "Gooru - "
               + socialDo.getTitle().replaceAll("\\+", "%2B")
               + ": "
               + socialDo.getBitlylink(),
           "_blank",
           "width=600,height=300");
     } else {
       triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false);
       //				Window.open("http://twitter.com/intent/tweet?text=" + "Check out
       // "+socialDo.getTitle().replaceAll("\\+", "%2B")+ "'s Gooru Profile Page - " +
       // socialDo.getBitlylink(), "_blank", "width=600,height=300");
       Window.open(
           "http://twitter.com/intent/tweet?text="
               + getEncodedUrl(i18n.GL1085_1())
               + socialDo.getBitlylink(),
           "_blank",
           "width=600,height=300");
     }
   } else {
     triggerShareDataEvent(PlayerDataLogEvents.TWITTER, false);
     Window.open(
         "http://twitter.com/intent/tweet?text="
             + "Gooru - "
             + socialDo.getTitle().replaceAll("\\+", "%2B")
             + ": "
             + socialDo.getBitlylink(),
         "_blank",
         "width=600,height=300");
   }
 }
  public void setData(List<UserTagsResourceDO> result) {

    tagContainer.setVisible(true);
    TagTextMessage.setText(i18n.GL1915());
    TagTextMessage.getElement().setId("lblTagTextMessage");
    TagTextMessage.getElement().setAttribute("alt", i18n.GL1915());
    TagTextMessage.getElement().setAttribute("title", i18n.GL1915());

    tagMessage.setText(i18n.GL1944());
    tagMessage.getElement().setId("lblTagMessage");
    tagMessage.getElement().setAttribute("alt", i18n.GL1944());
    tagMessage.getElement().setAttribute("title", i18n.GL1944());

    tagContainer.getElement().setAttribute("alt", labelName);
    tagContainer.setTitle(labelName);

    /*if(labelName.length()>=12){
    	labelName = labelName.substring(0, 12) + "...";
    }*/
    tagType.setText(labelName);
    tagType.getElement().setId("lblTagType");
    tagType.getElement().setAttribute("alt", labelName);
    tagType.getElement().setAttribute("title", labelName);

    tagCount.setText(count);
    tagCount.getElement().setId("lblTagCount");
    tagCount.getElement().setAttribute("alt", count);
    tagCount.getElement().setAttribute("title", count);

    userTagsResourceContainerConatiner.clear();
    for (int i = 0; i < result.size(); i++) {
      ProfileUserTagsResourceWidget profileUserTagsResourceWidget =
          new ProfileUserTagsResourceWidget(result.get(i));
      userTagsResourceContainerConatiner.add(profileUserTagsResourceWidget);
    }

    tagContainer.getElement().setId("pnlTagContainer");
    tagScrollPanel.getElement().setId("sbTagScrollPanel");
    userTagsResourceContainerConatiner.getElement().setId("pnlUserTagsResourceContainerConatiner");
  }
 public void setFilePermissionMessage() {
   lblGooruFieldTrip.getElement().getStyle().setPaddingLeft(50, Unit.PX);
   lblGooruFieldTrip.getElement().getStyle().setPaddingRight(50, Unit.PX);
   lblGooruFieldTrip.setText(i18n.GL2169());
 }
 public void setFileDeletedMessage() {
   btnResourceLink.removeFromParent();
   lblGooruFieldTrip.getElement().getStyle().setPaddingLeft(50, Unit.PX);
   lblGooruFieldTrip.getElement().getStyle().setPaddingRight(50, Unit.PX);
   lblGooruFieldTrip.setText(i18n.GL2169());
 }
Пример #14
0
  /**
   * Class constructor
   *
   * @param collectionDo instance of {@link CollectionDo}
   */
  public SocialShareView(SocialShareDo shareDo) {

    this.socialDo = shareDo;

    initWidget(uiBinder.createAndBindUi(this));
    shareTextPanel.getElement().setId("pnlShareTextPanel");
    fbPanel.getElement().setId("epnlFbPanel");
    twitterPanel.getElement().setId("epnlTwitterPanel");
    emailPanel.getElement().setId("epnlEmailPanel");
    panelTwitter.getElement().setId("pnlPanelTwitter");
    panelEmail.getElement().setId("pnlPanelEmail");
    emailText.getElement().setInnerHTML(i18n.GL0212());
    emailText.getElement().setId("pnlEmailText");
    emailText.getElement().setAttribute("alt", i18n.GL0212());
    emailText.getElement().setAttribute("title", i18n.GL0212());
    twitterText.getElement().setInnerHTML(i18n.GL0647());
    twitterText.getElement().setId("pnlTwitterText");
    twitterText.getElement().setAttribute("alt", i18n.GL0647());
    twitterText.getElement().setAttribute("title", i18n.GL0647());
    facbookText.getElement().setInnerHTML(i18n.GL0646());
    facbookText.getElement().setId("pnlFacbookText");
    facbookText.getElement().setAttribute("alt", i18n.GL0646());
    facbookText.getElement().setAttribute("title", i18n.GL0646());
    shareIconPanel.getElement().setId("pnlShareIconPanel");
    fbIconPanel.getElement().setId("epnlFbIconPanel");
    panelfbIcon.getElement().setId("pnlPanelfbIcon");
    twIconPanel.getElement().setId("epnlTwIconPanel");
    panelTwIcon.getElement().setId("pnlPanelTwIcon");
    emailIconPanel.getElement().setId("epnlEmailIconPanel");
    panelEmailIcon.getElement().setId("pnlPanelEmailIcon");
    categoryImage.getElement().setId("imgCategoryImage");

    category = socialDo.getCategoryType() != null ? socialDo.getCategoryType() : "collection";
    description = socialDo.getDescription();
    String title = socialDo.getTitle();
    if (description == null) {
      description = "";
    } else {
      description = description.replaceAll("\\<.*?\\>", "");
    }

    if (title == null) {
      title = "";
    }

    setPresenter(new SocialSharePresenter(this));
    //		shareTextPanel.getElement().getStyle().setCursor(Cursor.POINTER);

    try {
      if (socialDo.getIsSearchShare()) {
        socialShareContainer.getElement().getStyle().setWidth(100, Unit.PX);
      }
    } catch (Exception e) {

    }

    if (socialDo.isOnlyIcon()) {
      shareTextPanel.setVisible(false);
      shareIconPanel.setVisible(true);
    } else {
      shareIconPanel.setVisible(false);
      shareTextPanel.setVisible(true);
    }

    if (title.contains("img")) {
      socialDo.setTitle(i18n.GL0308());
    } else {
      if (title.length() > 50) {
        title = title.substring(0, 50) + "...";
        socialDo.setTitle(title.replaceAll("<p>", "").replaceAll("</p>", ""));
      } else {
        socialDo.setTitle(title.replaceAll("<p>", "").replaceAll("</p>", ""));
      }
    }
    //        if(AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.SHELF)){
    if ((socialDo.getShareType().equalsIgnoreCase("private"))) {

      panelfbIcon.setStyleName(socialShareStyle.classPageShareButtonsFTEBgDisable());
      panelTwIcon.setStyleName(socialShareStyle.classPageShareButtonsFTEBgDisable());
      panelEmailIcon.setStyleName(socialShareStyle.classPageShareButtonsFTEBgDisable());

      fbPanel.setStyleName(socialShareStyle.classPageShareButtonsBgDisable());
      panelTwitter.setStyleName(socialShareStyle.classPageShareButtonsBgDisable());
      panelEmail.setStyleName(socialShareStyle.classPageShareButtonsBgDisable());

      //				shareTextPanel.getElement().getStyle().setCursor(Cursor.DEFAULT);
      //				shareIconPanel.getElement().getStyle().setCursor(Cursor.DEFAULT);
    } else {

      panelfbIcon.setStyleName(socialShareStyle.fbPageShareIconButtonsBg());
      panelTwIcon.setStyleName(socialShareStyle.twitterPageShareIconButtonsBg());
      panelEmailIcon.setStyleName(socialShareStyle.classPageShareButtonsFTEBg());

      fbPanel.setStyleName(socialShareStyle.fbPageShareButtonsBg());
      panelTwitter.setStyleName(socialShareStyle.twitterPageShareButtonsBg());
      panelEmail.setStyleName(socialShareStyle.classPageShareButtonsBg());

      //				shareTextPanel.getElement().getStyle().setCursor(Cursor.POINTER);
      //				shareIconPanel.getElement().getStyle().setCursor(Cursor.POINTER);
    }
    //		}

    //		categoryImage.addErrorHandler(new ErrorHandler() {
    //
    //			@Override
    //			public void onError(ErrorEvent event) {
    //				String url = socialDo.getThumbnailurl();
    //				if (url == null || url.endsWith("null") || url.contains("null") || url.endsWith("/")){
    //					if(category==null){
    //						categoryImage.setUrl(DEFULT_IMAGE);
    //					}
    //					else if (category.equalsIgnoreCase("collection")) {
    //						categoryImage.setUrl(DEFULT_IMAGE);
    //					} else if (category.equalsIgnoreCase("video")) {
    //						categoryImage.setUrl(DEFULT_VIMAGE);
    //					} else if (category.equalsIgnoreCase("question")) {
    //						categoryImage.setUrl(DEFULT_QIMAGE);
    //					} else if (category.equalsIgnoreCase("interactive")) {
    //						categoryImage.setUrl(DEFULT_IIMAGE);
    //					} else if
    // (category.equalsIgnoreCase("website")||category.equalsIgnoreCase("exam")||category.equalsIgnoreCase("webpage")) {
    //						categoryImage.setUrl(DEFULT_WIMAGE);
    //					} else if (category.equalsIgnoreCase("slide")||category.equalsIgnoreCase("image")){
    //						categoryImage.setUrl(DEFULT_ITYPEIMAGE);
    //					} else if
    // (category.equalsIgnoreCase("textbook")||category.equalsIgnoreCase("handout")||category.equalsIgnoreCase("lesson")||category.equalsIgnoreCase("text")) {
    //						categoryImage.setUrl(DEFULT_TEXTIMAGE);
    //					} else if (category.equalsIgnoreCase("audio")) {
    //						categoryImage.setUrl(DEFULT_AIMAGE);
    //					} else if (category.equalsIgnoreCase("other")) {
    //						categoryImage.setUrl(DEFULT_OIMAGE);
    //					} else if (category.equalsIgnoreCase("profile")){
    //						categoryImage.setUrl(DEFAULT_PROFILEIMAGE);
    //					}
    //				}
    //				socialDo.setThumbnailurl(categoryImage.getUrl());
    //			}
    //		});
    //		setUrl(socialDo.getThumbnailurl());
    if (AppClientFactory.getCurrentPlaceToken().equalsIgnoreCase(PlaceTokens.PROFILE_PAGE)) {
      isProfilePageView = true;
    }

    /**
     * Adding Event Handler.
     *
     * @param UpdateSocialShareMetaDataEvent.TYPE is type of event.
     * @param setHeader is Object of Handler.
     */
    AppClientFactory.getEventBus().addHandler(UpdateSocialShareMetaDataEvent.TYPE, setHeader);
  }
Пример #15
0
 /**
  * @function setUiText
  * @created_date : 26-Feb-2015
  * @description
  * @parm(s) :
  * @return : void
  * @throws : <Mentioned if any exceptions>
  */
 public void setUiText() {
   msgPanel.getElement().setInnerHTML(i18n.GL1983());
   msgPanel.getElement().setAttribute("alt", i18n.GL1983());
   msgPanel.getElement().setAttribute("title", i18n.GL1983());
   msglinkPanel.getElement().setInnerHTML(i18n.GL1984());
   msglinkPanel.getElement().setAttribute("alt", i18n.GL1984());
   msglinkPanel.getElement().setAttribute("title", i18n.GL1984());
   gooruPanel.getElement().setInnerHTML(i18n.GL0733());
   gooruPanel.getElement().setAttribute("alt", i18n.GL0733());
   gooruPanel.getElement().setAttribute("title", i18n.GL0733());
   ednovoPanel.getElement().setInnerHTML(i18n.GL1985());
   ednovoPanel.getElement().setAttribute("alt", i18n.GL1985());
   ednovoPanel.getElement().setAttribute("title", i18n.GL1985());
   appstorePanel.getElement().setInnerHTML(i18n.GL1986());
   appstorePanel.getElement().setAttribute("alt", i18n.GL1986());
   appstorePanel.getElement().setAttribute("title", i18n.GL1986());
   viewAnchor.setText(i18n.GL1428());
   viewAnchor.getElement().setAttribute("alt", i18n.GL1428());
   viewAnchor.getElement().setAttribute("title", i18n.GL1428());
 }
Пример #16
0
  @Inject
  public AddCollectionView() {
    setWidget(uiBinder.createAndBindUi(this));
    hideText.setText(i18n.GL0592());
    hideText.getElement().setId("lblHideText");
    hideText.getElement().setAttribute("alt", i18n.GL0592());
    hideText.getElement().setAttribute("title", i18n.GL0592());

    addcollectionText.getElement().setInnerHTML(i18n.GL0690());
    addcollectionText.getElement().setId("pnlAddcollectionText");
    addcollectionText.getElement().setAttribute("alt", i18n.GL0690());
    addcollectionText.getElement().setAttribute("title", i18n.GL0690());

    renameText.setText(i18n.GL0593());
    renameText.getElement().setId("lblRenameText");
    renameText.getElement().setAttribute("alt", i18n.GL0593());
    renameText.getElement().setAttribute("title", i18n.GL0593());

    addToShelfCollectionButton.setText(i18n.GL0590());
    addToShelfCollectionButton.getElement().setId("btnAddToShelfCollectionButton");
    addToShelfCollectionButton.getElement().setAttribute("alt", i18n.GL0590());
    addToShelfCollectionButton.getElement().setAttribute("title", i18n.GL0590());

    collectionAddedSuccessMessageContainer.setVisible(false);
    getAddToShelfCollectionButton().addClickHandler(new OnAddCollectionClick());
    collectionTitleInCoverPage.addKeyUpHandler(new onKeyErrorMsg());
    workSpaceLink.setText(i18n.GL0589());
    workSpaceLink.getElement().setId("lnkWorkSpaceLink");
    workSpaceLink.getElement().setAttribute("alt", i18n.GL0589());
    workSpaceLink.getElement().setAttribute("title", i18n.GL0589());

    addToCollectionWidgetContainer.getElement().setId("pnlAddToCollectionWidgetContainer");
    collectionAddImageContainer.getElement().setId("pnlCollectionAddImageContainer");
    addResourceInsteadLabelContainerInCollectionImage
        .getElement()
        .setId("pnlAddResourceInsteadLabelContainerInCollectionImage");
    collectionAddedSuccessMessageContainer
        .getElement()
        .setId("pnlCollectionAddedSuccessMessageContainer");
    successMessageLabelText.getElement().setId("lblSuccessMessageLabelText");
    addCollectionInsteadLabelContainer.getElement().setId("pnlAddCollectionInsteadLabelContainer");
    collectionTitleInCoverPage.getElement().setId("txtCollectionTitleInCoverPage");
    StringUtil.setAttributes(collectionTitleInCoverPage, true);
    addingLabel.getElement().setId("lblAddingLabel");
    addErrorLabel.getElement().setId("errlblAddErrorLabel");
    hideButton.getElement().setId("epnlHideButton");
  }
  public NewClasspagePopupView() {

    this.res = NewClasspagePopupCBundle.INSTANCE;
    res.css().ensureInjected();
    setWidget(uiBinder.createAndBindUi(this));
    // this.getElement().getStyle().setWidth(450,Unit.PX);
    btnCancel.addClickHandler(new CloseExistsClickHandler());
    btnAdd.addClickHandler(new AddExistsClickHandler());
    classpageTitleTxt.getElement().setAttribute("placeholder", i18n.GL1124());
    classpageTitleTxt.getElement().setAttribute("maxlength", "50");
    classpageTitleTxt.getElement().setId("txtClassPageTitle");
    StringUtil.setAttributes(classpageTitleTxt, true);
    bodyConatiner.getElement().getStyle().setPadding(15, Unit.PX);
    titlePanel.getElement().getStyle().setMarginBottom(10, Unit.PX);

    btnAdd.getElement().setId("btnAdd");
    btnAdd.setText(i18n.GL0745());
    btnAdd.getElement().setAttribute("alt", i18n.GL0745());
    btnAdd.getElement().setAttribute("title", i18n.GL0745());

    btnCancel.setText(i18n.GL0142());
    btnCancel.getElement().setId("btnCancel");
    btnCancel.getElement().setAttribute("alt", i18n.GL0142());
    btnCancel.getElement().setAttribute("title", i18n.GL0142());

    titlePanel.getElement().setInnerText(i18n.GL0318());
    titlePanel.getElement().setId("pnlTitle");
    titlePanel.getElement().setAttribute("alt", i18n.GL0318());
    titlePanel.getElement().setAttribute("title", i18n.GL0318());

    headerPanel.getElement().setInnerText(i18n.GL0747());
    headerPanel.getElement().setId("pnlHeader");
    headerPanel.getElement().setAttribute("alt", i18n.GL0747());
    headerPanel.getElement().setAttribute("title", i18n.GL0747());
    mandatoryClasspageTitleLbl.setText(i18n.GL0746());
    mandatoryClasspageTitleLbl.getElement().setId("lblMandatoryClasspageTitle");
    mandatoryClasspageTitleLbl.getElement().setAttribute("alt", i18n.GL0746());
    mandatoryClasspageTitleLbl.getElement().setAttribute("title", i18n.GL0746());

    classpageTitleTxt.addBlurHandler(
        new BlurHandler() {

          @Override
          public void onBlur(BlurEvent event) {
            Map<String, String> parms = new HashMap<String, String>();
            parms.put("text", classpageTitleTxt.getText());
            AppClientFactory.getInjector()
                .getResourceService()
                .checkProfanity(
                    parms,
                    new SimpleAsyncCallback<Boolean>() {

                      @Override
                      public void onSuccess(Boolean value) {
                        boolean isHavingBadWords = value;
                        if (value) {
                          classpageTitleTxt.getElement().getStyle().setBorderColor("orange");
                          mandatoryClasspageTitleLbl.setText(i18n.GL0554());
                          mandatoryClasspageTitleLbl.setVisible(true);
                        } else {
                          classpageTitleTxt.getElement().getStyle().clearBackgroundColor();
                          classpageTitleTxt.getElement().getStyle().setBorderColor("#ccc");
                          mandatoryClasspageTitleLbl.setVisible(false);
                        }
                      }
                    });
          }
        });

    classpageTitleTxt.addKeyUpHandler(new TitleKeyUpHandler());
    setModal(true);
    Window.enableScrolling(false);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false));
    mandatoryClasspageTitleLbl.setVisible(false);
    //		panelLoading.setVisible(false);
    panelPleaseWait.setVisible(false);
    panelLoading.setText(i18n.GL0122());
    panelControls.setVisible(true);
    show();
    center();
    classpageTitleTxt.setFocus(true);
    panelLoading.getElement().setId("pnlLoading");
    panelControls.getElement().setId("pnlControls");
  }
  /** @param collectionItemDo */
  @UiConstructor
  public ResourceFrameBreakerView(final CollectionItemDo collectionItemDo, boolean isGoogleFile) {
    initWidget(uiBinder.createAndBindUi(this));
    PlayerBundle.INSTANCE.getPlayerStyle().ensureInjected();
    this.collectionItemDo = collectionItemDo;
    if (!isGoogleFile) {
      setLabelsAndIds();
      supportTip.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().supportTip());
      supportTip.setText(i18n.GL1453());
      supportTip.getElement().setId("lblSupportTip");
      supportTip.getElement().setAttribute("alt", i18n.GL1453());
      supportTip.getElement().setAttribute("title", i18n.GL1453());
      btnResourceLink.addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().btnResourceLink());
    } else {
      btnResourceLink.removeFromParent();
    }
    imgFieldTrip.setUrl(collectionItemDo.getResource().getThumbnailUrl());
    if (collectionItemDo.getResource().getResourceFormat() != null) {
      defaultResourceCategory = collectionItemDo.getResource().getResourceFormat().getDisplayName();
    }
    if (defaultResourceCategory != null) {
      if (defaultResourceCategory.equalsIgnoreCase("Lesson")
          || defaultResourceCategory.equalsIgnoreCase("Textbook")
          || defaultResourceCategory.equalsIgnoreCase("Handout")) {
        defaultResourceCategory =
            defaultResourceCategory
                .replaceAll("Lesson", "Text")
                .replaceAll("Textbook", "Text")
                .replaceAll("Handout", "Text")
                .replaceAll("lesson", "Text")
                .replaceAll("textbook", "Text")
                .replaceAll("handout", "Text");
      }
      if (defaultResourceCategory.equalsIgnoreCase("Slide")) {
        defaultResourceCategory =
            defaultResourceCategory.replaceAll("Slide", "Image").replaceAll("slide", "Image");
      }
      if (defaultResourceCategory.equalsIgnoreCase("Exam")
          || defaultResourceCategory.equalsIgnoreCase("Challenge")
          || defaultResourceCategory.equalsIgnoreCase("Website")) {
        defaultResourceCategory =
            defaultResourceCategory
                .replaceAll("Exam", "Webpage")
                .replaceAll("Challenge", "Webpage")
                .replaceAll("exam", "Webpage")
                .replaceAll("challenge", "Webpage");
      }
    }
    imgFieldTrip.addErrorHandler(
        new ErrorHandler() {

          @Override
          public void onError(ErrorEvent event) {
            imgFieldTrip.setUrl(DEFULT_IMAGE_PREFIX + defaultResourceCategory.toLowerCase() + PNG);
          }
        });
    if (collectionItemDo.getResource().getResourceFormat() != null) {
      resourceCategory.addStyleName(
          getResourceTypeImage(
              collectionItemDo.getResource().getResourceFormat().getDisplayName()));
    }
  }
 private void renderQuestionView() {
   hintsLength = 0;
   if (collectionItemDo != null && collectionItemDo.getResource() != null) {
     String titlelbl1 =
         InfoUtil.removeQuestionTagsOnBoldClick(
             StringUtil.isEmpty(collectionItemDo.getResource().getQuestionText())
                 ? ""
                 : collectionItemDo.getResource().getQuestionText());
     openEndedQuestionText.setHTML(removeHtmlTags(titlelbl1));
     openEndedQuestionText
         .getElement()
         .setAttribute(
             "alt",
             StringUtil.removeAllHtmlCss(
                 StringUtil.isEmpty(collectionItemDo.getResource().getQuestionText())
                     ? ""
                     : collectionItemDo.getResource().getQuestionText()));
     openEndedQuestionText
         .getElement()
         .setAttribute(
             "title",
             StringUtil.removeAllHtmlCss(
                 StringUtil.isEmpty(collectionItemDo.getResource().getQuestionText())
                     ? ""
                     : collectionItemDo.getResource().getQuestionText()));
     if (collectionItemDo.getResource().getHints() != null
         && collectionItemDo.getResource().getHints().size() > 0) {
       hintsButton.setText(
           " "
               + i18n.GL0317()
               + " ("
               + collectionItemDo.getResource().getHints().size()
               + " Left)");
       hintsButton
           .getElement()
           .setAttribute(
               "alt",
               " "
                   + i18n.GL0317()
                   + " ("
                   + collectionItemDo.getResource().getHints().size()
                   + " Left)");
       hintsButton
           .getElement()
           .setAttribute(
               "title",
               " "
                   + i18n.GL0317()
                   + " ("
                   + collectionItemDo.getResource().getHints().size()
                   + " Left)");
     } else {
       hintsButton.setStyleName(oeStyle.hintsInActiveButton());
     }
     if (collectionItemDo.getResource().getExplanation() != null
         && collectionItemDo.getResource().getExplanation().trim().length() > 0) {
     } else {
       explanaionButton.setStyleName(oeStyle.hintsInActiveButton());
     }
     if (!StringUtil.isEmpty(getQuestionImage())) {
       openEndedQuestionImage.setUrl(getQuestionImage());
     }
   }
 }