https://resources.docmosis.com/Documentation/Tornado/2.9.2/Tornado-Template-Guide.pdf
Sunday, 4 June 2023
Tuesday, 1 February 2022
JavaScript - Single Line IF ELSE
properties['Value'] = (IsItMuted === true) ? 'On' : 'Off';
The ? : is called a ternary operator and acts just like an if/else when used in an expression
var testValue= (props.brtUser === 'No') ? 'Promote to User' : 'Demote to Contact';
Use this <p>{testValue}</p>
Friday, 7 January 2022
What is OSGI?
OSGI Lifecycle
Since Liferay has adopted OSGI standards it is necessary for us to know basic's of OSGI.
OSGI-stands for Open Services Gateway initiative.
Basic OSGI Module Lifecycle
OSGI Lifecycle includes following states
- Installed
- Resolved
- Starting
- Active
- Stopping
- Uninstalled
1) Installed
The bundle has been installed into the OSGi container, but some required bundle dependencies is missing the bundle in this state can’t be start.
2) Resolved
When bundle is in resolved state means all the required
dependencies is available.And bundle is ready to be started.
3) Starting
Bundle is being started and BundleActivator.start() method is
executed.
Bundle with lazy activation policy stay in this state until one of
class file is loaded.It is state between resolved and active.
4) Active
The bundle is active and running.
5) Stopping
Bundle is being stopped & BundleActivator.stop() method is
executed.After stopping state is complete it again enters in to resolved state,Once enter in resolved state it can again started.
6) Uninstalled
Bundle has been removed from OSGI container.
Wednesday, 23 May 2018
Birthday Portlet
<%
SimpleDateFormat formatter = new SimpleDateFormat("MMM dd");
List<EmployeeDetails> list = EmployeeDetailsLocalServiceUtil.getEmployeeDetailses(-1, -1);
List<EmployeeDetails> blist = new ArrayList<>();
Date date = new Date();
for(EmployeeDetails e : list){
Date dob = e.getDob();
if( dob.getDate() == date.getDate() && dob.getMonth() == date.getMonth()){
blist.add(e);
}
}
%>
<%if(blist.isEmpty()){%>
<b>There is no B day</b>
<%}else if(!list.isEmpty()){
for(EmployeeDetails emp : blist){%>
<%
FileEntry dlfileentry = DLAppServiceUtil.getFileEntry(emp.getFileEntryId());
String imageURL ="/documents/" + dlfileentry.getGroupId() + "/"
+ dlfileentry.getFolderId() + "/" + dlfileentry.getTitle()
+ "/" + dlfileentry.getUuid();
%>
<a href="<%=imageURL%>"><img src="<%=imageURL%>" alt="image" class="mmm"/></a>
<p class="bday nomargin"><%=emp.getEmployeename() %></p>
<b class="wish">Wish you happy B day</b>
<%String dates=formatter.format(emp.getDob()); %>
<p class="bday"><%=dates%></p>
<%} }%>
SimpleDateFormat formatter = new SimpleDateFormat("MMM dd");
List<EmployeeDetails> list = EmployeeDetailsLocalServiceUtil.getEmployeeDetailses(-1, -1);
List<EmployeeDetails> blist = new ArrayList<>();
Date date = new Date();
for(EmployeeDetails e : list){
Date dob = e.getDob();
if( dob.getDate() == date.getDate() && dob.getMonth() == date.getMonth()){
blist.add(e);
}
}
%>
<%if(blist.isEmpty()){%>
<b>There is no B day</b>
<%}else if(!list.isEmpty()){
for(EmployeeDetails emp : blist){%>
<%
FileEntry dlfileentry = DLAppServiceUtil.getFileEntry(emp.getFileEntryId());
String imageURL ="/documents/" + dlfileentry.getGroupId() + "/"
+ dlfileentry.getFolderId() + "/" + dlfileentry.getTitle()
+ "/" + dlfileentry.getUuid();
%>
<a href="<%=imageURL%>"><img src="<%=imageURL%>" alt="image" class="mmm"/></a>
<p class="bday nomargin"><%=emp.getEmployeename() %></p>
<b class="wish">Wish you happy B day</b>
<%String dates=formatter.format(emp.getDob()); %>
<p class="bday"><%=dates%></p>
<%} }%>
Search By User Name
In jsp
<%PortletURL userNameURL = renderResponse.createActionURL();
userNameURL.setParameter(ActionRequest.ACTION_NAME, "userfilter");%>
<%
List<Billclaim> bill = null;
if(request.getAttribute("fn") != null){
bill = (List<Billclaim>) request.getAttribute("fn");
}else{
bill = BillclaimLocalServiceUtil.getBillclaims(-1, -1);
}
%>
<aui:form method="POST" name="fm" action="<%=userNameURL.toString() %>" >
<aui:input type="text" label="" name="userName" placeholder="Search By User Name">
</aui:input>
<aui:button type="submit" value="Search"/>
</aui:form>
BillclaimLocalServiceImpl.java
public List<Billclaim> getUserName(String userName){
return billclaimPersistence.findByuserName(userName);
}
Controller
public void userfilter(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException, SystemException, PortalException {
String userName = ParamUtil.getString(actionRequest, "userName");
List<Billclaim> fn = BillclaimLocalServiceUtil.getUserName(userName);
actionRequest.setAttribute("fn", fn);
actionResponse.setRenderParameter("jspPage", "/billView.jsp");
SessionMessages.add(actionRequest, "searched");
}
Service.xml
<finder name="userName" return-type="Collection">
<finder-column name="userName"></finder-column>
</finder>
<%PortletURL userNameURL = renderResponse.createActionURL();
userNameURL.setParameter(ActionRequest.ACTION_NAME, "userfilter");%>
<%
List<Billclaim> bill = null;
if(request.getAttribute("fn") != null){
bill = (List<Billclaim>) request.getAttribute("fn");
}else{
bill = BillclaimLocalServiceUtil.getBillclaims(-1, -1);
}
%>
<aui:form method="POST" name="fm" action="<%=userNameURL.toString() %>" >
<aui:input type="text" label="" name="userName" placeholder="Search By User Name">
</aui:input>
<aui:button type="submit" value="Search"/>
</aui:form>
BillclaimLocalServiceImpl.java
public List<Billclaim> getUserName(String userName){
return billclaimPersistence.findByuserName(userName);
}
Controller
public void userfilter(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException, SystemException, PortalException {
String userName = ParamUtil.getString(actionRequest, "userName");
List<Billclaim> fn = BillclaimLocalServiceUtil.getUserName(userName);
actionRequest.setAttribute("fn", fn);
actionResponse.setRenderParameter("jspPage", "/billView.jsp");
SessionMessages.add(actionRequest, "searched");
}
Service.xml
<finder name="userName" return-type="Collection">
<finder-column name="userName"></finder-column>
</finder>
Wednesday, 25 April 2018
Status Pending & Approved using action
JSP:
<aui:option value="<%=billClaimPortletKeys.pending %>">Pending for approval</aui:option><aui:option value="<%=billClaimPortletKeys.approved%>">Approved</aui:option>
Constants file
public class billClaimPortletKeys {
public static final String billClaim = "BillClaim";
public static final String approved = "Approved";
public static final String pending = "Pending For Approval";
public static final String medical = "Medical";
public static final String travel = "Travel";
public static final String food = "Food";
public static final String variablepay = "Variablepay";
public static final String teamouting = "Team Outing";
public static final String others = "Others";
}
action.jsp
<%
ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
Billclaim bill = (Billclaim) row.getObject();
long fooId = ParamUtil.getLong(request, "fooId");
PortletURL approvedURL = renderResponse.createActionURL();
approvedURL.setParameter(ActionRequest.ACTION_NAME, "approved");
approvedURL.setParameter("fooId", String.valueOf(bill.getFooId()));
%>
<liferay-ui:icon-menu>
<%{ %>
<liferay-ui:icon image="delete" message="Delete" url="<%= deleteBillURL.toString()%>" />
<liferay-ui:icon image="check" message="Approved" url="<%=approvedURL.toString() %>" />
<%} %>
</liferay-ui:icon-menu>
Controller
public void approved(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException, SystemException, PortalException {
Billclaim billclaim =null;
String approved = billClaimPortletKeys.approved;
long fooId = ParamUtil.getLong(actionRequest, "fooId");
System.out.println("FooooID##################" +fooId);
billclaim = BillclaimLocalServiceUtil.fetchBillclaim(fooId);
billclaim.setStatus(approved);
BillclaimLocalServiceUtil.updateBillclaim(billclaim);
}
Thursday, 19 April 2018
SMS Configuration using sms horizon API
Step 1 - Login Sms horizon & get username & API key (http://smshorizon.co.in/api/sendsms.php?user=Mufas&apikey=LPDkKtHkmkRk8XEtbjrt&mobile=9620367054&message=welcome&senderid=saleem&type=txt)
Step 2 - Create Portet.properties inside resources folder
This is my user name & my api
smsuserid=mufas
password=LPDkKtHkmkRk8XEtbjrt
message= Thank you for submitting you feedback.
smsapi=http://smshorizon.co.in/api/sendsms.php?
Step 3 - Call sendsms() method in controller.
public void sendMsg() throws UnsupportedEncodingException {
System.out.println("SMS Working complaint #########################");
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");
String userName = configuration.get("smsuserid");
String password = configuration.get("password");
String textMessage = configuration.get("message");
String smsapi = configuration.get("smsapi");
StringBuilder smsSenderURLQueryString = new StringBuilder();
smsSenderURLQueryString.append("user="
+ URLEncoder.encode(userName, "UTF-8"));
smsSenderURLQueryString.append("&apikey="
+ URLEncoder.encode(password,
"UTF-8"));
smsSenderURLQueryString.append("&mobile="
+ URLEncoder.encode("9620367054", "UTF-8"));
smsSenderURLQueryString.append("&message="
+ URLEncoder.encode(textMessage, "UTF-8"));
smsSenderURLQueryString.append("&senderid="
+ URLEncoder.encode("MYTEXT", "UTF-8"));
smsSenderURLQueryString.append("&type=" + "TXT");
String completeSenderURLString = smsapi +smsSenderURLQueryString.toString();
HttpURLConnection connection = null;
URL completeSenderURL = null;
String conncetionResponse = null;
try{
completeSenderURL = new URL(completeSenderURLString);
connection = (HttpURLConnection) completeSenderURL.openConnection();
connection.setDoOutput(false);
connection.setDoInput(true);
conncetionResponse = connection.getResponseMessage();
int responseCode = connection.getResponseCode();
String responseMessage = connection.getResponseMessage();
}catch(Exception e){
}
}
Step 2 - Create Portet.properties inside resources folder
This is my user name & my api
smsuserid=mufas
password=LPDkKtHkmkRk8XEtbjrt
message= Thank you for submitting you feedback.
smsapi=http://smshorizon.co.in/api/sendsms.php?
Step 3 - Call sendsms() method in controller.
public void sendMsg() throws UnsupportedEncodingException {
System.out.println("SMS Working complaint #########################");
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");
String userName = configuration.get("smsuserid");
String password = configuration.get("password");
String textMessage = configuration.get("message");
String smsapi = configuration.get("smsapi");
StringBuilder smsSenderURLQueryString = new StringBuilder();
smsSenderURLQueryString.append("user="
+ URLEncoder.encode(userName, "UTF-8"));
smsSenderURLQueryString.append("&apikey="
+ URLEncoder.encode(password,
"UTF-8"));
smsSenderURLQueryString.append("&mobile="
+ URLEncoder.encode("9620367054", "UTF-8"));
smsSenderURLQueryString.append("&message="
+ URLEncoder.encode(textMessage, "UTF-8"));
smsSenderURLQueryString.append("&senderid="
+ URLEncoder.encode("MYTEXT", "UTF-8"));
smsSenderURLQueryString.append("&type=" + "TXT");
String completeSenderURLString = smsapi +smsSenderURLQueryString.toString();
HttpURLConnection connection = null;
URL completeSenderURL = null;
String conncetionResponse = null;
try{
completeSenderURL = new URL(completeSenderURLString);
connection = (HttpURLConnection) completeSenderURL.openConnection();
connection.setDoOutput(false);
connection.setDoInput(true);
conncetionResponse = connection.getResponseMessage();
int responseCode = connection.getResponseCode();
String responseMessage = connection.getResponseMessage();
}catch(Exception e){
}
}
Wednesday, 18 April 2018
SMTP CONFIGURATION USING EXT PROPERTIES
Step 1 - Inside server portal-ext.properties add this
mail.session.mail.imap.host=192.99.42.143
mail.session.mail.pop3.host=192.99.42.143
mail.session.mail.smtp.auth=true
mail.session.mail.smtp.host=smtp.gmail.com
mail.session.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.session.mail.smtp.socketFactory.fallback=false
mail.session.mail.smtp.socketFactory.port=465
mail.session.mail.smtp.starttls.enable=true
mail.session.mail.smtp.password=muhammedsaleem
mail.session.mail.smtp.port=465
mail.session.mail.smtp.user=callsaleem@gmail.com
mail.session.mail.store.protocol=imap
mail.session.mail.transport.protocol=smtp
Step 2 - Restart the server
Step 3 - Open build.gradle
Add this line: compile 'javax.mail:mail:1.4.7'
Step - 4 Create Send mail method in controller
public void sendMailWithPlainText() {
InternetAddress fromAddress = null;
InternetAddress toAddress = null;
try {
fromAddress = new InternetAddress("xyz@gmail.com");
toAddress = new InternetAddress("abc@gmail.com");
MailMessage mailMessage = new MailMessage();
mailMessage.setTo(toAddress);
mailMessage.setFrom(fromAddress);
mailMessage.setSubject("Your Bill is claimed successfully");
mailMessage.setBody("Hi,<br>Your content<br><br>Best Regards,<br>Mufas");
mailMessage.setHTMLFormat(true);
MailServiceUtil.sendEmail(mailMessage);
System.out.println("Send mail with Plain Text");
} catch (AddressException e) {
e.printStackTrace();
}
}
Step -5 : Call the send mail method
sendMailWithPlainText()
mail.session.mail.imap.host=192.99.42.143
mail.session.mail.pop3.host=192.99.42.143
mail.session.mail.smtp.auth=true
mail.session.mail.smtp.host=smtp.gmail.com
mail.session.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.session.mail.smtp.socketFactory.fallback=false
mail.session.mail.smtp.socketFactory.port=465
mail.session.mail.smtp.starttls.enable=true
mail.session.mail.smtp.password=muhammedsaleem
mail.session.mail.smtp.port=465
mail.session.mail.smtp.user=callsaleem@gmail.com
mail.session.mail.store.protocol=imap
mail.session.mail.transport.protocol=smtp
Step 2 - Restart the server
Step 3 - Open build.gradle
Add this line: compile 'javax.mail:mail:1.4.7'
Step - 4 Create Send mail method in controller
public void sendMailWithPlainText() {
InternetAddress fromAddress = null;
InternetAddress toAddress = null;
try {
fromAddress = new InternetAddress("xyz@gmail.com");
toAddress = new InternetAddress("abc@gmail.com");
MailMessage mailMessage = new MailMessage();
mailMessage.setTo(toAddress);
mailMessage.setFrom(fromAddress);
mailMessage.setSubject("Your Bill is claimed successfully");
mailMessage.setBody("Hi,<br>Your content<br><br>Best Regards,<br>Mufas");
mailMessage.setHTMLFormat(true);
MailServiceUtil.sendEmail(mailMessage);
System.out.println("Send mail with Plain Text");
} catch (AddressException e) {
e.printStackTrace();
}
}
Step -5 : Call the send mail method
sendMailWithPlainText()
Friday, 13 April 2018
Aui Auto Field
<aui:input name="skills" type="textarea" label="skills" >
<aui:validator name="required" />
</aui:input>
<aui:script use="autocomplete-list,aui-base,autocomplete-filters,autocomplete-highlighters">
var skills = [
{"name":"Java"},
{"name":"Alfresco"},
{"name":"HTML"},
{"name":"C++"},
{"name":"Liferay"},
{"name":"Python"},
{"name":"C"},
{"name":"SQL"},
{"name":"JavaScript"},
{"name":"C#"},
{"name":"PHP"},
{"name":"CSS"},
{"name":"Bootstrap"},
{"name":"jQuery"},
{"name":"AngularJS"},
{"name":"AJAX"}
];
new A.AutoCompleteList(
{
allowBrowserAutocomplete: 'false',
activateFirstItem: 'true',
inputNode: '#<portlet:namespace/>skills',
resultTextLocator: 'name',
resultHighlighter:'phraseMatch',
resultFilters: ['startsWith'],
minQueryLength: 1,
maxResults: 10,
queryDelimiter : ',',
render: 'true',
source:skills
});
</aui:script>
<aui:validator name="required" />
</aui:input>
<aui:script use="autocomplete-list,aui-base,autocomplete-filters,autocomplete-highlighters">
var skills = [
{"name":"Java"},
{"name":"Alfresco"},
{"name":"HTML"},
{"name":"C++"},
{"name":"Liferay"},
{"name":"Python"},
{"name":"C"},
{"name":"SQL"},
{"name":"JavaScript"},
{"name":"C#"},
{"name":"PHP"},
{"name":"CSS"},
{"name":"Bootstrap"},
{"name":"jQuery"},
{"name":"AngularJS"},
{"name":"AJAX"}
];
new A.AutoCompleteList(
{
allowBrowserAutocomplete: 'false',
activateFirstItem: 'true',
inputNode: '#<portlet:namespace/>skills',
resultTextLocator: 'name',
resultHighlighter:'phraseMatch',
resultFilters: ['startsWith'],
minQueryLength: 1,
maxResults: 10,
queryDelimiter : ',',
render: 'true',
source:skills
});
</aui:script>
Monday, 26 March 2018
Aui validation for Pancard & Passport & Aadhar Validations
1] Remove Aui type submit
2] Inside input Add Class
<p id="id"></p>
<aui:button value="Save" onClick="submitFormsss();"/>
<script type="text/javascript">
function submitFormsss() {
var panVal = $('.panNumber').val();
var passVal = $('.passNumber').val();
var aadharVal = $('.aadhar').val();
var regpan = /^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$/;
var regpassport = /^([a-zA-Z]){1}([0-9]){7}?$/;
var regaadhar = /^([0-9]){12}?$/;
if(regpan.test(panVal) && regpassport.test(passVal) && regaadhar.test(aadharVal)){
document.<portlet:namespace />fm.submit();
}else if(!regpan.test(panVal)){
alert("Please enter valid Pan number")
document.getElementById("pan").innerHTML = "Please Provide Valid Pan Number";
}else if(!regpassport.test(passVal)){
document.getElementById("pass").innerHTML = "Please Provide Valid Passport Number";
}else if(!regaadhar.test(aadharVal)){
document.getElementById("aadhar").innerHTML = "Please Provide Valid Aadhar Number";
}
}
</script>
2] Inside input Add Class
<p id="id"></p>
<aui:button value="Save" onClick="submitFormsss();"/>
<script type="text/javascript">
function submitFormsss() {
var panVal = $('.panNumber').val();
var passVal = $('.passNumber').val();
var aadharVal = $('.aadhar').val();
var regpan = /^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$/;
var regpassport = /^([a-zA-Z]){1}([0-9]){7}?$/;
var regaadhar = /^([0-9]){12}?$/;
if(regpan.test(panVal) && regpassport.test(passVal) && regaadhar.test(aadharVal)){
document.<portlet:namespace />fm.submit();
}else if(!regpan.test(panVal)){
alert("Please enter valid Pan number")
document.getElementById("pan").innerHTML = "Please Provide Valid Pan Number";
}else if(!regpassport.test(passVal)){
document.getElementById("pass").innerHTML = "Please Provide Valid Passport Number";
}else if(!regaadhar.test(aadharVal)){
document.getElementById("aadhar").innerHTML = "Please Provide Valid Aadhar Number";
}
}
</script>
Monday, 12 March 2018
How to Embed portlet in liferay theme
Liferay 7
<@liferay_portlet["runtime"]
portletName="my_custom_portlet_WAR_mycustomportlet"
/>
Liferay 6.2
$theme.runtime("bottomlink_WAR_EKHUBportlet")
<@liferay_portlet["runtime"]
portletName="my_custom_portlet_WAR_mycustomportlet"
/>
Liferay 6.2
$theme.runtime("bottomlink_WAR_EKHUBportlet")
Sunday, 11 March 2018
Adding a Plugins Portlet to the Control Panel
Step 1:Specify where the portlet will appear in Control Panel
Open your liferay-portlet.xml. Add the below tags after <icon> tag
<control-panel-entry-category>apps</control-panel-entry-category><control-panel-entry-weight>0</control-panel-entry-weight> Note 1: In the above code the line <control-panel-entry-category>apps</control-panel-entry-category> says where our portlet will appear in the Control Panel. Note 2: The Tag <control-panel-entry-weight>
represents location vertically in the given category. According to our
code Book Portlet will appear at first position in apps category.
Step 2:Make the portlet hidden
In this step we put the portlet in hidden category so that it's not available anywhere other than Control Panel. This is done by modifying liferay-display.xml. For example. <display><category name="category.hidden"><portlet id="book-portlet" /></category></display> That's it. Now your portlet available in Control Panel. Tuesday, 28 November 2017
AM PM convert to preferred language
jquery_var(".am_pm").html(function(i,str){
if(str.indexOf('AM') > 0){
return str.replace('AM',Liferay.Language.get("AM"));
}
if(str.indexOf('PM') > 0){
return str.replace('PM',Liferay.Language.get("PM"));
}
});
if(str.indexOf('AM') > 0){
return str.replace('AM',Liferay.Language.get("AM"));
}
if(str.indexOf('PM') > 0){
return str.replace('PM',Liferay.Language.get("PM"));
}
});
Tuesday, 17 October 2017
Disable mouse right click
Professional Way
$(document).keydown(function(event){
if(event.keyCode==123){
return false;
}
else if (event.ctrlKey && event.shiftKey && event.keyCode==73){
return false;
}
});
$(document).on("contextmenu",function(e){
e.preventDefault();
});
It's unprofessional
document.oncontextmenu = document.body.oncontextmenu = function() {return false;}
Sunday, 6 August 2017
Create Account URL & Forgot Password URL In theme level
REGISTER
$CreateAccountURL.setPortletMode("view")
$CreateAccountURL.setWindowState("maximized")
$CreateAccountURL.setParameter("struts_action", "/login/create_account")
$CreateAccountURL.setParameter("", "")
<a href="$CreateAccountURL">REGISTER</a>
FORGOT PASSWORD
#set ($forgetpasswordURL = $portletURLFactory.create($request, "58", $page.getPlid(), "RENDER_PHASE"))$forgetpasswordURL.setPortletMode("view")
$forgetpasswordURL.setWindowState("maximized")
$forgetpasswordURL.setParameter("struts_action", "/login/forgot_password")
$forgetpasswordURL.setParameter("", "")
<a href="$forgetpasswordURL">FORGOT PASSWORD</a>
Wednesday, 26 July 2017
Mobile & tab device rotation page refresh
Device rotation page will get refresh
jquery_var(window).on("orientationchange",function(event){
console.log('window change');
var width = 768;
var windowwidth =
jquery_var(window).width();
var windowheight =
jquery_var(window).height();
console.log('width...'+width);
console.log('windowwidth...'+windowwidth);
console.log('windowheight...'+windowheight);
if(((windowwidth
<= width) && (windowheight >= width)) || ((windowwidth >=
width) && (windowheight <= width)))
{
console.log('Inside.. condition ...');
window.location.reload(true);
}
});
Monday, 24 July 2017
Window size measurement
<div id="divInitial"></div>
<div id="divResize"></div>
$("#divInitial").text("Initial Window width: " + $(window).width() + ", height: " + $(window).height() + ".");
//Event to handle resizing
$(window).resize(function () {
var winwidth = $(window).width();
var width = winwidth+"px"
var winheight = $(window).height();
var height = winheight +"px"
//alert("width:"+ width + " and height:"+ height);
$("#divResize").text("Window width: " + width + ", height: " + height + ".");
});
Wednesday, 5 July 2017
Monday, 3 July 2017
Mobile & tablet view Portlet place change
if(jquery_var(window).width() <= 768){
var div1 = jquery_var("#p_p_id_invitationAppportlet_WAR_employerwatchListportlet_");
jquery_var('#p_p_id_companyInfoportlet_WAR_companyInfoportlet_').insertBefore(div1);
}
var div1 = jquery_var("#p_p_id_invitationAppportlet_WAR_employerwatchListportlet_");
jquery_var('#p_p_id_companyInfoportlet_WAR_companyInfoportlet_').insertBefore(div1);
}
Bootstrap accordion only mobile & tablet
<script>
if(jquery_var(window).width() <= 768){
jquery_var('#pan').addClass('panel');
jquery_var('#pan-head').addClass('panel-heading');
jquery_var('#pan-title').addClass('panel-title');
jquery_var('#pan-click').addClass('pull-right clickable');
jquery_var('#pan-body').addClass('panel-body panel-body-white');
}
</script>
Add & Remove Attribute
jquery_var("#Id").removeAttr("readonly");
Subscribe to:
Posts (Atom)